<!-- HTML header for doxygen 1.8.13-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.9.2"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Hardware Abstraction Layer (HAL)</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen_style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><a href="http://www.cypress.com/"><img alt="Logo" src="logo.png"/></a></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">Hardware Abstraction Layer (HAL)</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.2 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search",'Search','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(document).ready(function(){initNavTree('group__group__hal__i2s.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#groups">API Reference</a> &#124;
<a href="#nested-classes">Data Structures</a> &#124;
<a href="#typedef-members">Typedefs</a> &#124;
<a href="#enum-members">Enumerations</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle"><div class="title">I2S (Inter-IC Sound)<div class="ingroups"><a class="el" href="group__group__hal.html">HAL Drivers</a></div></div></div>
</div><!--header-->
<div class="contents">
<a name="details" id="details"></a><h2 class="groupheader">General Description</h2>
<p >High level interface for interacting with the Inter-IC Sound (I2S). </p>
<p >The I2S protocol is a asynchronous serial interface protocol. This driver supports both transmit and receive modes of operation. The communication frequency, sample rate, word size, and channel size can all be configured.</p>
<dl class="section note"><dt>Note</dt><dd>Certain platforms may not support all of the functionality and configuration options provided by this driver. Please refer to implementation specific documentation for details on available options.</dd></dl>
<h1><a class="anchor" id="section_i2s_features"></a>
Features</h1>
<ul>
<li>Transmit and receive functionality</li>
<li>Configurable data rates</li>
<li>Configurable channel and word size</li>
<li>Configurable interrupt and callback assignment from I2S events - <a class="el" href="group__group__hal__i2s.html#ga98bc78188673aae2c4e27b660a3f20fe">cyhal_i2s_event_t</a></li>
</ul>
<h1><a class="anchor" id="section_i2s_quickstart"></a>
Quick Start</h1>
<p >Initialize an I2S instance using the <a class="el" href="group__group__hal__i2s.html#gad1008bd6dc716300e3e7d5482390eaf1">cyhal_i2s_init</a> and provide the transmit (tx) and/or receive (rx) pins. Call <a class="el" href="group__group__hal__i2s.html#gabe95fc12ff1d9264a60e8eeda35d885a">cyhal_i2s_start_tx</a> and/or <a class="el" href="group__group__hal__i2s.html#gabc95dd1600db8fdb379e7e7cc3d39039">cyhal_i2s_start_rx</a> to enable transmit and/or receive functionality as desired.<br  />
 See <a class="el" href="group__group__hal__i2s.html#subsection_i2s_snippet_1">Snippet 1: I2S Initialization and Configuration</a> for example initialization as transmit or receive. </p><dl class="section note"><dt>Note</dt><dd>The clock parameter (const <a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__clock__t">cyhal_clock_t</a> *clk) is optional and can be set to NULL to generate and use an available clock resource with a default frequency.</dd></dl>
<p>The sclk frequency is determined as <code>sclk = sample_rate_hz * channel_length * 2</code> (multiplying by 2 for 2 channels - left and right). The input clock must be a multiple of this sclk frequency; see the implementation specific documentation for the supported multipliers.</p>
<p >It is possible to use either only TX functionality, only RX functionality, or both RX and TX functionality at the same time. If RX and TX are both in use, the same sample rate, channel length, word length, sclk frequency will be used for both.</p>
<h1><a class="anchor" id="section_i2s_snippets"></a>
Code Snippets</h1>
<h2><a class="anchor" id="subsection_i2s_snippet_1"></a>
Snippet 1: I2S Initialization and Configuration</h2>
<p >This snippet initializes an I2S resource for transmit or receive and assigns the pins.</p>
<p >Initializing as I2S transmitter </p><div class="fragment"><div class="line"><span class="preprocessor">    #if defined(CYHAL_DRIVER_AVAILABLE_I2S_TX)</span></div>
<div class="line">    <a class="code hl_struct" href="group__group__hal__impl__hw__types.html#struct__cyhal__audioss__t">cyhal_i2s_t</a>        i2s;</div>
<div class="line">    <a class="code hl_struct" href="group__group__hal__i2s.html#structcyhal__i2s__pins__t">cyhal_i2s_pins_t</a>   tx_pins = { .<a class="code hl_variable" href="group__group__hal__i2s.html#a06f418e1a73780daacabb034e78ad0d9">sck</a> = <a class="code hl_enumvalue" href="group__group__hal__impl__pin__package__psoc6__01__104__m__csp__ble.html#gga707195ce0627016bf371643bdd9caa51a6e81efad69a0ea034651af008bd857b9">P5_1</a>, .ws = <a class="code hl_enumvalue" href="group__group__hal__impl__pin__package__psoc6__01__104__m__csp__ble.html#gga707195ce0627016bf371643bdd9caa51a48fead26a455d15e627a59f49e735ed6">P5_2</a>, .data = <a class="code hl_enumvalue" href="group__group__hal__impl__pin__package__psoc6__01__104__m__csp__ble.html#gga707195ce0627016bf371643bdd9caa51ac4e840a9752ddcf910485a9ad3bda6c3">P5_3</a>, .mclk = <a class="code hl_enumvalue" href="group__group__hal__impl__pin__package__psoc6__01__104__m__csp__ble.html#gga707195ce0627016bf371643bdd9caa51a3dbd1016ea99d087d747530418b89a01">NC</a> };</div>
<div class="line">    <a class="code hl_struct" href="group__group__hal__i2s.html#structcyhal__i2s__config__t">cyhal_i2s_config_t</a> config  =</div>
<div class="line">    {</div>
<div class="line">        .<a class="code hl_variable" href="group__group__hal__i2s.html#aa83c7a4b2a6f43a7ef74ad0d23c6546c">is_tx_slave</a>    = <span class="keyword">false</span>,</div>
<div class="line">        .is_rx_slave    = <span class="keyword">false</span>,</div>
<div class="line">        .mclk_hz        = 0,</div>
<div class="line">        .channel_length = 32,</div>
<div class="line">        .word_length    = 32,</div>
<div class="line">        .sample_rate_hz = 44000</div>
<div class="line">    };</div>
<div class="line">    <a class="code hl_typedef" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a> result = <a class="code hl_function" href="group__group__hal__i2s.html#gad1008bd6dc716300e3e7d5482390eaf1">cyhal_i2s_init</a>(&amp;i2s, &amp;tx_pins, NULL, &amp;config, NULL);</div>
<div class="line">    <span class="keywordflow">if</span> (<a class="code hl_define" href="group__group__result.html#gaf58fac450d9fff4472f03ad68f6e546e">CY_RSLT_SUCCESS</a> != result)</div>
<div class="line">    {</div>
<div class="line">        <span class="comment">// Handle error</span></div>
<div class="line">    }</div>
<div class="line"><span class="preprocessor">    #endif </span><span class="comment">// if defined(CYHAL_DRIVER_AVAILABLE_I2S_TX)</span></div>
<div class="ttc" id="agroup__group__hal__i2s_html_a06f418e1a73780daacabb034e78ad0d9"><div class="ttname"><a href="group__group__hal__i2s.html#a06f418e1a73780daacabb034e78ad0d9">cyhal_i2s_pins_t::sck</a></div><div class="ttdeci">cyhal_gpio_t sck</div><div class="ttdoc">Clock pin.</div><div class="ttdef"><b>Definition:</b> cyhal_i2s.h:182</div></div>
<div class="ttc" id="agroup__group__hal__i2s_html_aa83c7a4b2a6f43a7ef74ad0d23c6546c"><div class="ttname"><a href="group__group__hal__i2s.html#aa83c7a4b2a6f43a7ef74ad0d23c6546c">cyhal_i2s_config_t::is_tx_slave</a></div><div class="ttdeci">bool is_tx_slave</div><div class="ttdoc">Configure TX to operate a slave (true) or master (false)</div><div class="ttdef"><b>Definition:</b> cyhal_i2s.h:191</div></div>
<div class="ttc" id="agroup__group__hal__i2s_html_gad1008bd6dc716300e3e7d5482390eaf1"><div class="ttname"><a href="group__group__hal__i2s.html#gad1008bd6dc716300e3e7d5482390eaf1">cyhal_i2s_init</a></div><div class="ttdeci">cy_rslt_t cyhal_i2s_init(cyhal_i2s_t *obj, const cyhal_i2s_pins_t *tx_pins, const cyhal_i2s_pins_t *rx_pins, const cyhal_i2s_config_t *config, cyhal_clock_t *clk)</div><div class="ttdoc">Initialize the I2S peripheral.</div></div>
<div class="ttc" id="agroup__group__hal__i2s_html_structcyhal__i2s__config__t"><div class="ttname"><a href="group__group__hal__i2s.html#structcyhal__i2s__config__t">cyhal_i2s_config_t</a></div><div class="ttdoc">I2S Configuration.</div><div class="ttdef"><b>Definition:</b> cyhal_i2s.h:189</div></div>
<div class="ttc" id="agroup__group__hal__i2s_html_structcyhal__i2s__pins__t"><div class="ttname"><a href="group__group__hal__i2s.html#structcyhal__i2s__pins__t">cyhal_i2s_pins_t</a></div><div class="ttdoc">Pins to use for one I2S direction.</div><div class="ttdef"><b>Definition:</b> cyhal_i2s.h:181</div></div>
<div class="ttc" id="agroup__group__hal__impl__hw__types_html_struct__cyhal__audioss__t"><div class="ttname"><a href="group__group__hal__impl__hw__types.html#struct__cyhal__audioss__t">_cyhal_audioss_t</a></div><div class="ttdoc">Shared data between i2s and tdm.</div><div class="ttdef"><b>Definition:</b> cyhal_hw_types.h:356</div></div>
<div class="ttc" id="agroup__group__hal__impl__pin__package__psoc6__01__104__m__csp__ble_html_gga707195ce0627016bf371643bdd9caa51a3dbd1016ea99d087d747530418b89a01"><div class="ttname"><a href="group__group__hal__impl__pin__package__psoc6__01__104__m__csp__ble.html#gga707195ce0627016bf371643bdd9caa51a3dbd1016ea99d087d747530418b89a01">NC</a></div><div class="ttdeci">@ NC</div><div class="ttdoc">No Connect/Invalid Pin.</div><div class="ttdef"><b>Definition:</b> cyhal_psoc6_01_104_m_csp_ble.h:53</div></div>
<div class="ttc" id="agroup__group__hal__impl__pin__package__psoc6__01__104__m__csp__ble_html_gga707195ce0627016bf371643bdd9caa51a48fead26a455d15e627a59f49e735ed6"><div class="ttname"><a href="group__group__hal__impl__pin__package__psoc6__01__104__m__csp__ble.html#gga707195ce0627016bf371643bdd9caa51a48fead26a455d15e627a59f49e735ed6">P5_2</a></div><div class="ttdeci">@ P5_2</div><div class="ttdoc">Port 5 Pin 2.</div><div class="ttdef"><b>Definition:</b> cyhal_psoc6_01_104_m_csp_ble.h:70</div></div>
<div class="ttc" id="agroup__group__hal__impl__pin__package__psoc6__01__104__m__csp__ble_html_gga707195ce0627016bf371643bdd9caa51a6e81efad69a0ea034651af008bd857b9"><div class="ttname"><a href="group__group__hal__impl__pin__package__psoc6__01__104__m__csp__ble.html#gga707195ce0627016bf371643bdd9caa51a6e81efad69a0ea034651af008bd857b9">P5_1</a></div><div class="ttdeci">@ P5_1</div><div class="ttdoc">Port 5 Pin 1.</div><div class="ttdef"><b>Definition:</b> cyhal_psoc6_01_104_m_csp_ble.h:69</div></div>
<div class="ttc" id="agroup__group__hal__impl__pin__package__psoc6__01__104__m__csp__ble_html_gga707195ce0627016bf371643bdd9caa51ac4e840a9752ddcf910485a9ad3bda6c3"><div class="ttname"><a href="group__group__hal__impl__pin__package__psoc6__01__104__m__csp__ble.html#gga707195ce0627016bf371643bdd9caa51ac4e840a9752ddcf910485a9ad3bda6c3">P5_3</a></div><div class="ttdeci">@ P5_3</div><div class="ttdoc">Port 5 Pin 3.</div><div class="ttdef"><b>Definition:</b> cyhal_psoc6_01_104_m_csp_ble.h:71</div></div>
<div class="ttc" id="agroup__group__result_html_gaca79700fcc701534ce61778a9bcf57d1"><div class="ttname"><a href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a></div><div class="ttdeci">uint32_t cy_rslt_t</div><div class="ttdoc">Provides the result of an operation as a structured bitfield.</div><div class="ttdef"><b>Definition:</b> cy_result.h:438</div></div>
<div class="ttc" id="agroup__group__result_html_gaf58fac450d9fff4472f03ad68f6e546e"><div class="ttname"><a href="group__group__result.html#gaf58fac450d9fff4472f03ad68f6e546e">CY_RSLT_SUCCESS</a></div><div class="ttdeci">#define CY_RSLT_SUCCESS</div><div class="ttdoc">cy_rslt_t return value indicating success</div><div class="ttdef"><b>Definition:</b> cy_result.h:465</div></div>
</div><!-- fragment --><p >Initializing as I2S receiver </p><div class="fragment"><div class="line"><span class="preprocessor">    #if defined(CYHAL_DRIVER_AVAILABLE_I2S_RX)</span></div>
<div class="line">    <a class="code hl_struct" href="group__group__hal__impl__hw__types.html#struct__cyhal__audioss__t">cyhal_i2s_t</a>        i2s;</div>
<div class="line">    <a class="code hl_struct" href="group__group__hal__i2s.html#structcyhal__i2s__pins__t">cyhal_i2s_pins_t</a>   rx_pins = { .<a class="code hl_variable" href="group__group__hal__i2s.html#a06f418e1a73780daacabb034e78ad0d9">sck</a> = <a class="code hl_enumvalue" href="group__group__hal__impl__pin__package__psoc6__01__104__m__csp__ble.html#gga707195ce0627016bf371643bdd9caa51a3f2896cca74b9552337ba66e54412050">P5_4</a>, .ws = <a class="code hl_enumvalue" href="group__group__hal__impl__pin__package__psoc6__01__104__m__csp__ble.html#gga707195ce0627016bf371643bdd9caa51a8ab80e76a8624109b9b303f2d2c3645d">P5_5</a>, .data = <a class="code hl_enumvalue" href="group__group__hal__impl__pin__package__psoc6__01__104__m__csp__ble.html#gga707195ce0627016bf371643bdd9caa51a5a6e676f2fbd259451a8035c6d286748">P5_6</a>, .mclk = <a class="code hl_enumvalue" href="group__group__hal__impl__pin__package__psoc6__01__104__m__csp__ble.html#gga707195ce0627016bf371643bdd9caa51a3dbd1016ea99d087d747530418b89a01">NC</a> };</div>
<div class="line">    <a class="code hl_struct" href="group__group__hal__i2s.html#structcyhal__i2s__config__t">cyhal_i2s_config_t</a> config  =</div>
<div class="line">    {</div>
<div class="line">        .<a class="code hl_variable" href="group__group__hal__i2s.html#aa83c7a4b2a6f43a7ef74ad0d23c6546c">is_tx_slave</a>    = <span class="keyword">false</span>,</div>
<div class="line">        .is_rx_slave    = <span class="keyword">true</span>,</div>
<div class="line">        .mclk_hz        = 0,</div>
<div class="line">        .channel_length = 32,</div>
<div class="line">        .word_length    = 32,</div>
<div class="line">        .sample_rate_hz = 44000</div>
<div class="line">    };</div>
<div class="line">    <a class="code hl_typedef" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a> result = <a class="code hl_function" href="group__group__hal__i2s.html#gad1008bd6dc716300e3e7d5482390eaf1">cyhal_i2s_init</a>(&amp;i2s, NULL, &amp;rx_pins, &amp;config, NULL);</div>
<div class="line">    <span class="keywordflow">if</span> (<a class="code hl_define" href="group__group__result.html#gaf58fac450d9fff4472f03ad68f6e546e">CY_RSLT_SUCCESS</a> != result)</div>
<div class="line">    {</div>
<div class="line">        <span class="comment">// Handle error</span></div>
<div class="line">    }</div>
<div class="line"><span class="preprocessor">    #endif </span><span class="comment">// if defined(CYHAL_DRIVER_AVAILABLE_I2S_RX)</span></div>
<div class="ttc" id="agroup__group__hal__impl__pin__package__psoc6__01__104__m__csp__ble_html_gga707195ce0627016bf371643bdd9caa51a3f2896cca74b9552337ba66e54412050"><div class="ttname"><a href="group__group__hal__impl__pin__package__psoc6__01__104__m__csp__ble.html#gga707195ce0627016bf371643bdd9caa51a3f2896cca74b9552337ba66e54412050">P5_4</a></div><div class="ttdeci">@ P5_4</div><div class="ttdoc">Port 5 Pin 4.</div><div class="ttdef"><b>Definition:</b> cyhal_psoc6_01_104_m_csp_ble.h:72</div></div>
<div class="ttc" id="agroup__group__hal__impl__pin__package__psoc6__01__104__m__csp__ble_html_gga707195ce0627016bf371643bdd9caa51a5a6e676f2fbd259451a8035c6d286748"><div class="ttname"><a href="group__group__hal__impl__pin__package__psoc6__01__104__m__csp__ble.html#gga707195ce0627016bf371643bdd9caa51a5a6e676f2fbd259451a8035c6d286748">P5_6</a></div><div class="ttdeci">@ P5_6</div><div class="ttdoc">Port 5 Pin 6.</div><div class="ttdef"><b>Definition:</b> cyhal_psoc6_01_104_m_csp_ble.h:74</div></div>
<div class="ttc" id="agroup__group__hal__impl__pin__package__psoc6__01__104__m__csp__ble_html_gga707195ce0627016bf371643bdd9caa51a8ab80e76a8624109b9b303f2d2c3645d"><div class="ttname"><a href="group__group__hal__impl__pin__package__psoc6__01__104__m__csp__ble.html#gga707195ce0627016bf371643bdd9caa51a8ab80e76a8624109b9b303f2d2c3645d">P5_5</a></div><div class="ttdeci">@ P5_5</div><div class="ttdoc">Port 5 Pin 5.</div><div class="ttdef"><b>Definition:</b> cyhal_psoc6_01_104_m_csp_ble.h:73</div></div>
</div><!-- fragment --><h2><a class="anchor" id="subsection_i2s_snippet_2"></a>
Snippet 2: I2S Transmit One-shot</h2>
<p >This snippet shows how to transmit data using <a class="el" href="group__group__hal__i2s.html#ga5f4dd73de0bd46bee15d82fe793f5ca3">cyhal_i2s_write_async</a> when the entire sample is available at once. <br  />
</p>
<div class="fragment"><div class="line"><span class="preprocessor">#if defined(CYHAL_DRIVER_AVAILABLE_I2S_TX)</span></div>
<div class="line"><span class="keyword">static</span> <span class="keywordtype">void</span> i2s_event_handler_transmit_one_shot(<span class="keywordtype">void</span>* arg, <a class="code hl_enumeration" href="group__group__hal__i2s.html#ga98bc78188673aae2c4e27b660a3f20fe">cyhal_i2s_event_t</a> event)</div>
<div class="line">{</div>
<div class="line">    <span class="comment">// When we registered the callback, we set &#39;arg&#39; to point to the i2s object</span></div>
<div class="line">    <a class="code hl_struct" href="group__group__hal__impl__hw__types.html#struct__cyhal__audioss__t">cyhal_i2s_t</a>* i2s = (<a class="code hl_struct" href="group__group__hal__impl__hw__types.html#struct__cyhal__audioss__t">cyhal_i2s_t</a>*)arg;</div>
<div class="line">    <span class="keywordflow">if</span> (0u != (event &amp; <a class="code hl_enumvalue" href="group__group__hal__i2s.html#gga98bc78188673aae2c4e27b660a3f20feaf860cfe6a5c38f054a44b53f854c8126">CYHAL_I2S_TX_EMPTY</a>))</div>
<div class="line">    {</div>
<div class="line">        <a class="code hl_function" href="group__group__hal__i2s.html#gae809b73f16e9dbc25e12c0c2687e1ba0">cyhal_i2s_stop_tx</a>(i2s);</div>
<div class="line">    }</div>
<div class="line">}</div>
<div class="line"> </div>
<div class="line"> </div>
<div class="line"><span class="comment">// Data to transmit, defined e.g. an array stored in flash</span></div>
<div class="line"><span class="keyword">extern</span> <span class="keyword">const</span> uint32_t* i2s_tx_buffer;</div>
<div class="line"><span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">size_t</span>    i2s_tx_buffer_len;</div>
<div class="line"><a class="code hl_typedef" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a> snippet_cyhal_i2s_async_transmit_one_shot(<span class="keywordtype">void</span>)</div>
<div class="line">{</div>
<div class="line">    <a class="code hl_struct" href="group__group__hal__impl__hw__types.html#struct__cyhal__audioss__t">cyhal_i2s_t</a> i2s;</div>
<div class="line">    <span class="comment">// Initialize the object as shown in Snippet 1</span></div>
<div class="line"> </div>
<div class="line">    <span class="comment">// Register a callback and set the callback argument to be a pointer to the I2S object, so that</span></div>
<div class="line">    <span class="comment">// we can easily reference it from the callback handler.</span></div>
<div class="line">    <a class="code hl_function" href="group__group__hal__i2s.html#gade0855962b32a1b4d4dbb9bbf9b6354b">cyhal_i2s_register_callback</a>(&amp;i2s, &amp;i2s_event_handler_transmit_one_shot, &amp;i2s);</div>
<div class="line"> </div>
<div class="line">    <span class="comment">// Subscribe to the TX Empty event so that we can stop the interface when the transfer is</span></div>
<div class="line">    <span class="comment">// complete</span></div>
<div class="line">    <a class="code hl_function" href="group__group__hal__i2s.html#gac8adecacf62147f30023e69010b52bf9">cyhal_i2s_enable_event</a>(&amp;i2s, <a class="code hl_enumvalue" href="group__group__hal__i2s.html#gga98bc78188673aae2c4e27b660a3f20feaf860cfe6a5c38f054a44b53f854c8126">CYHAL_I2S_TX_EMPTY</a>, <a class="code hl_define" href="group__group__hal__impl__hw__types.html#gad822a466fc63847114add720ef84c83a">CYHAL_ISR_PRIORITY_DEFAULT</a>, <span class="keyword">true</span>);</div>
<div class="line"> </div>
<div class="line">    <a class="code hl_typedef" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a> result = <a class="code hl_function" href="group__group__hal__i2s.html#ga5f4dd73de0bd46bee15d82fe793f5ca3">cyhal_i2s_write_async</a>(&amp;i2s, i2s_tx_buffer, i2s_tx_buffer_len);</div>
<div class="line"> </div>
<div class="line">    <span class="keywordflow">if</span> (<a class="code hl_define" href="group__group__result.html#gaf58fac450d9fff4472f03ad68f6e546e">CY_RSLT_SUCCESS</a> == result)</div>
<div class="line">    {</div>
<div class="line">        result = <a class="code hl_function" href="group__group__hal__i2s.html#gabe95fc12ff1d9264a60e8eeda35d885a">cyhal_i2s_start_tx</a>(&amp;i2s);</div>
<div class="line">    }</div>
<div class="line"> </div>
<div class="line">    <span class="keywordflow">return</span> result;</div>
<div class="line">}</div>
<div class="line"> </div>
<div class="line"> </div>
<div class="line"><span class="preprocessor">#endif </span><span class="comment">// if defined(CYHAL_DRIVER_AVAILABLE_I2S_TX)</span></div>
<div class="ttc" id="agroup__group__hal__i2s_html_ga5f4dd73de0bd46bee15d82fe793f5ca3"><div class="ttname"><a href="group__group__hal__i2s.html#ga5f4dd73de0bd46bee15d82fe793f5ca3">cyhal_i2s_write_async</a></div><div class="ttdeci">cy_rslt_t cyhal_i2s_write_async(cyhal_i2s_t *obj, const void *tx, size_t tx_length)</div><div class="ttdoc">Start I2S asynchronous write.</div></div>
<div class="ttc" id="agroup__group__hal__i2s_html_ga98bc78188673aae2c4e27b660a3f20fe"><div class="ttname"><a href="group__group__hal__i2s.html#ga98bc78188673aae2c4e27b660a3f20fe">cyhal_i2s_event_t</a></div><div class="ttdeci">cyhal_i2s_event_t</div><div class="ttdoc">I2S events.</div><div class="ttdef"><b>Definition:</b> cyhal_i2s.h:143</div></div>
<div class="ttc" id="agroup__group__hal__i2s_html_gabe95fc12ff1d9264a60e8eeda35d885a"><div class="ttname"><a href="group__group__hal__i2s.html#gabe95fc12ff1d9264a60e8eeda35d885a">cyhal_i2s_start_tx</a></div><div class="ttdeci">cy_rslt_t cyhal_i2s_start_tx(cyhal_i2s_t *obj)</div><div class="ttdoc">Starts transmitting data.</div></div>
<div class="ttc" id="agroup__group__hal__i2s_html_gac8adecacf62147f30023e69010b52bf9"><div class="ttname"><a href="group__group__hal__i2s.html#gac8adecacf62147f30023e69010b52bf9">cyhal_i2s_enable_event</a></div><div class="ttdeci">void cyhal_i2s_enable_event(cyhal_i2s_t *obj, cyhal_i2s_event_t event, uint8_t intr_priority, bool enable)</div><div class="ttdoc">Configure I2S events.</div></div>
<div class="ttc" id="agroup__group__hal__i2s_html_gade0855962b32a1b4d4dbb9bbf9b6354b"><div class="ttname"><a href="group__group__hal__i2s.html#gade0855962b32a1b4d4dbb9bbf9b6354b">cyhal_i2s_register_callback</a></div><div class="ttdeci">void cyhal_i2s_register_callback(cyhal_i2s_t *obj, cyhal_i2s_event_callback_t callback, void *callback_arg)</div><div class="ttdoc">Register an I2S callback handler.</div></div>
<div class="ttc" id="agroup__group__hal__i2s_html_gae809b73f16e9dbc25e12c0c2687e1ba0"><div class="ttname"><a href="group__group__hal__i2s.html#gae809b73f16e9dbc25e12c0c2687e1ba0">cyhal_i2s_stop_tx</a></div><div class="ttdeci">cy_rslt_t cyhal_i2s_stop_tx(cyhal_i2s_t *obj)</div><div class="ttdoc">Stops transmitting data.</div></div>
<div class="ttc" id="agroup__group__hal__i2s_html_gga98bc78188673aae2c4e27b660a3f20feaf860cfe6a5c38f054a44b53f854c8126"><div class="ttname"><a href="group__group__hal__i2s.html#gga98bc78188673aae2c4e27b660a3f20feaf860cfe6a5c38f054a44b53f854c8126">CYHAL_I2S_TX_EMPTY</a></div><div class="ttdeci">@ CYHAL_I2S_TX_EMPTY</div><div class="ttdoc">TX HW Buffer is Empty.</div><div class="ttdef"><b>Definition:</b> cyhal_i2s.h:149</div></div>
<div class="ttc" id="agroup__group__hal__impl__hw__types_html_gad822a466fc63847114add720ef84c83a"><div class="ttname"><a href="group__group__hal__impl__hw__types.html#gad822a466fc63847114add720ef84c83a">CYHAL_ISR_PRIORITY_DEFAULT</a></div><div class="ttdeci">#define CYHAL_ISR_PRIORITY_DEFAULT</div><div class="ttdoc">Priority that is applied by default to all drivers when initialized.</div><div class="ttdef"><b>Definition:</b> cyhal_hw_types.h:114</div></div>
</div><!-- fragment --><h2><a class="anchor" id="subsection_i2s_snippet_3"></a>
Snippet 3: I2S Transmit Streaming</h2>
<p >This snippet shows how to transmit data using <a class="el" href="group__group__hal__i2s.html#ga5f4dd73de0bd46bee15d82fe793f5ca3">cyhal_i2s_write_async</a> when sample data is being continuously loaded and transmitted (e.g. streaming over the network). <br  />
</p>
<div class="fragment"><div class="line"><span class="preprocessor">#if defined(CYHAL_DRIVER_AVAILABLE_I2S_TX)</span></div>
<div class="line"><span class="comment">// We use a dual buffer system so that one buffer can be transmitting while the other is being</span></div>
<div class="line"><span class="comment">// filled</span></div>
<div class="line"><span class="preprocessor">#define BUFFER_SIZE 128u</span></div>
<div class="line"><span class="keyword">const</span> uint32_t  tx_buffer0[BUFFER_SIZE];</div>
<div class="line"><span class="keyword">const</span> uint32_t  tx_buffer1[BUFFER_SIZE];</div>
<div class="line"><span class="keyword">const</span> uint32_t* active_tx_buffer;</div>
<div class="line"><span class="keyword">const</span> uint32_t* next_tx_buffer;</div>
<div class="line"><span class="keyword">static</span> <span class="keywordtype">void</span> i2s_event_handler_transmit_streaming(<span class="keywordtype">void</span>* arg, <a class="code hl_enumeration" href="group__group__hal__i2s.html#ga98bc78188673aae2c4e27b660a3f20fe">cyhal_i2s_event_t</a> event)</div>
<div class="line">{</div>
<div class="line">    <span class="comment">// When we registered the callback, we set &#39;arg&#39; to point to the i2s object</span></div>
<div class="line">    <a class="code hl_struct" href="group__group__hal__impl__hw__types.html#struct__cyhal__audioss__t">cyhal_i2s_t</a>* i2s = (<a class="code hl_struct" href="group__group__hal__impl__hw__types.html#struct__cyhal__audioss__t">cyhal_i2s_t</a>*)arg;</div>
<div class="line">    <span class="keywordflow">if</span> (0u != (event &amp; <a class="code hl_enumvalue" href="group__group__hal__i2s.html#gga98bc78188673aae2c4e27b660a3f20fea090269cec878bec745bb2e393606e41e">CYHAL_I2S_ASYNC_TX_COMPLETE</a>))</div>
<div class="line">    {</div>
<div class="line">        <span class="comment">// Flip the active and the next tx buffers</span></div>
<div class="line">        <span class="keyword">const</span> uint32_t* temp = active_tx_buffer;</div>
<div class="line">        active_tx_buffer = next_tx_buffer;</div>
<div class="line">        next_tx_buffer   = temp;</div>
<div class="line"> </div>
<div class="line">        <span class="comment">// Start writing the next buffer while the just-freed one is repopulated</span></div>
<div class="line">        <a class="code hl_typedef" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a> result = <a class="code hl_function" href="group__group__hal__i2s.html#ga5f4dd73de0bd46bee15d82fe793f5ca3">cyhal_i2s_write_async</a>(i2s, active_tx_buffer, BUFFER_SIZE);</div>
<div class="line"> </div>
<div class="line">        <span class="keywordflow">if</span> (<a class="code hl_define" href="group__group__result.html#gaf58fac450d9fff4472f03ad68f6e546e">CY_RSLT_SUCCESS</a> == result)</div>
<div class="line">        {</div>
<div class="line">            <span class="comment">// Load the next set of data into next_tx_buffer</span></div>
<div class="line">        }</div>
<div class="line">    }</div>
<div class="line">}</div>
<div class="line"> </div>
<div class="line"> </div>
<div class="line"><a class="code hl_typedef" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a> snippet_cyhal_i2s_async_transmit_streaming(<span class="keywordtype">void</span>)</div>
<div class="line">{</div>
<div class="line">    <a class="code hl_struct" href="group__group__hal__impl__hw__types.html#struct__cyhal__audioss__t">cyhal_i2s_t</a> i2s;</div>
<div class="line">    <span class="comment">// Initialize the object as shown in Snippet 1</span></div>
<div class="line"> </div>
<div class="line">    <span class="comment">// Register a callback and set the callback argument to be a pointer to the I2S object, so that</span></div>
<div class="line">    <span class="comment">// we can easily reference it from the callback handler.</span></div>
<div class="line">    <a class="code hl_function" href="group__group__hal__i2s.html#gade0855962b32a1b4d4dbb9bbf9b6354b">cyhal_i2s_register_callback</a>(&amp;i2s, &amp;i2s_event_handler_transmit_streaming, &amp;i2s);</div>
<div class="line"> </div>
<div class="line">    <span class="comment">// Subscribe to the async complete event so that we can queue up another transfer when this one</span></div>
<div class="line">    <span class="comment">// completes</span></div>
<div class="line">    <a class="code hl_function" href="group__group__hal__i2s.html#gac8adecacf62147f30023e69010b52bf9">cyhal_i2s_enable_event</a>(&amp;i2s, <a class="code hl_enumvalue" href="group__group__hal__i2s.html#gga98bc78188673aae2c4e27b660a3f20fea090269cec878bec745bb2e393606e41e">CYHAL_I2S_ASYNC_TX_COMPLETE</a>, <a class="code hl_define" href="group__group__hal__impl__hw__types.html#gad822a466fc63847114add720ef84c83a">CYHAL_ISR_PRIORITY_DEFAULT</a>, <span class="keyword">true</span>);</div>
<div class="line"> </div>
<div class="line">    <span class="comment">// Configure asynchronous transfers to use DMA to free up the CPU during transfers</span></div>
<div class="line">    <a class="code hl_typedef" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a> result = <a class="code hl_function" href="group__group__hal__i2s.html#ga9fba9ea64bd2ec92a2ae41459020825c">cyhal_i2s_set_async_mode</a>(&amp;i2s, <a class="code hl_enumvalue" href="group__group__hal__general__types.html#ggab2d2acfb82599df54152be0b170c6ec2a580896db2028c77f9f89cb8772a1eb90">CYHAL_ASYNC_DMA</a>, <a class="code hl_define" href="group__group__hal__impl__dma.html#ga81946da56dd6ba8afd28f6056b1d779a">CYHAL_DMA_PRIORITY_DEFAULT</a>);</div>
<div class="line"> </div>
<div class="line">    <span class="keywordflow">if</span> (<a class="code hl_define" href="group__group__result.html#gaf58fac450d9fff4472f03ad68f6e546e">CY_RSLT_SUCCESS</a> == result)</div>
<div class="line">    {</div>
<div class="line">        <span class="comment">// Populate initial data in the two tx buffers (e.g. by streaming over the network)</span></div>
<div class="line"> </div>
<div class="line">        active_tx_buffer = tx_buffer0;</div>
<div class="line">        next_tx_buffer   = tx_buffer1;</div>
<div class="line"> </div>
<div class="line">        result = <a class="code hl_function" href="group__group__hal__i2s.html#ga5f4dd73de0bd46bee15d82fe793f5ca3">cyhal_i2s_write_async</a>(&amp;i2s, active_tx_buffer, BUFFER_SIZE);</div>
<div class="line">    }</div>
<div class="line"> </div>
<div class="line">    <span class="keywordflow">if</span> (<a class="code hl_define" href="group__group__result.html#gaf58fac450d9fff4472f03ad68f6e546e">CY_RSLT_SUCCESS</a> == result)</div>
<div class="line">    {</div>
<div class="line">        result = <a class="code hl_function" href="group__group__hal__i2s.html#gabe95fc12ff1d9264a60e8eeda35d885a">cyhal_i2s_start_tx</a>(&amp;i2s);</div>
<div class="line">    }</div>
<div class="line"> </div>
<div class="line">    <span class="keywordflow">return</span> result;</div>
<div class="line">}</div>
<div class="line"> </div>
<div class="line"> </div>
<div class="line"><span class="preprocessor">#endif </span><span class="comment">// if defined(CYHAL_DRIVER_AVAILABLE_I2S_TX)</span></div>
<div class="ttc" id="agroup__group__hal__general__types_html_ggab2d2acfb82599df54152be0b170c6ec2a580896db2028c77f9f89cb8772a1eb90"><div class="ttname"><a href="group__group__hal__general__types.html#ggab2d2acfb82599df54152be0b170c6ec2a580896db2028c77f9f89cb8772a1eb90">CYHAL_ASYNC_DMA</a></div><div class="ttdeci">@ CYHAL_ASYNC_DMA</div><div class="ttdoc">Use DMA if available.</div><div class="ttdef"><b>Definition:</b> cyhal_general_types.h:114</div></div>
<div class="ttc" id="agroup__group__hal__i2s_html_ga9fba9ea64bd2ec92a2ae41459020825c"><div class="ttname"><a href="group__group__hal__i2s.html#ga9fba9ea64bd2ec92a2ae41459020825c">cyhal_i2s_set_async_mode</a></div><div class="ttdeci">cy_rslt_t cyhal_i2s_set_async_mode(cyhal_i2s_t *obj, cyhal_async_mode_t mode, uint8_t dma_priority)</div><div class="ttdoc">Set the mechanism that is used to perform I2S asynchronous transfers.</div></div>
<div class="ttc" id="agroup__group__hal__i2s_html_gga98bc78188673aae2c4e27b660a3f20fea090269cec878bec745bb2e393606e41e"><div class="ttname"><a href="group__group__hal__i2s.html#gga98bc78188673aae2c4e27b660a3f20fea090269cec878bec745bb2e393606e41e">CYHAL_I2S_ASYNC_TX_COMPLETE</a></div><div class="ttdeci">@ CYHAL_I2S_ASYNC_TX_COMPLETE</div><div class="ttdoc">Pending async transmit is complete (but the HW buffer may still contain unsent data)</div><div class="ttdef"><b>Definition:</b> cyhal_i2s.h:155</div></div>
<div class="ttc" id="agroup__group__hal__impl__dma_html_ga81946da56dd6ba8afd28f6056b1d779a"><div class="ttname"><a href="group__group__hal__impl__dma.html#ga81946da56dd6ba8afd28f6056b1d779a">CYHAL_DMA_PRIORITY_DEFAULT</a></div><div class="ttdeci">#define CYHAL_DMA_PRIORITY_DEFAULT</div><div class="ttdoc">Default DMA channel priority.</div><div class="ttdef"><b>Definition:</b> cyhal_dma_impl.h:66</div></div>
</div><!-- fragment --><h2><a class="anchor" id="subsection_i2s_snippet_4"></a>
Snippet 4: I2S Receive</h2>
<p >This snippet shows how to receive data using <a class="el" href="group__group__hal__i2s.html#ga94357835c6f16b979680420f951d8980">cyhal_i2s_read_async</a>. <br  />
</p>
<div class="fragment"><div class="line"><span class="preprocessor">#if defined(CYHAL_DRIVER_AVAILABLE_I2S_RX)</span></div>
<div class="line"><span class="comment">// We use a dual buffer system so that one buffer can be filling while the other is being processed</span></div>
<div class="line"><span class="preprocessor">#define BUFFER_SIZE 128u</span></div>
<div class="line">uint32_t  rx_buffer0[BUFFER_SIZE];</div>
<div class="line">uint32_t  rx_buffer1[BUFFER_SIZE];</div>
<div class="line">uint32_t* active_rx_buffer;</div>
<div class="line">uint32_t* full_rx_buffer;</div>
<div class="line"><span class="keyword">static</span> <span class="keywordtype">void</span> i2s_event_handler_receive(<span class="keywordtype">void</span>* arg, <a class="code hl_enumeration" href="group__group__hal__i2s.html#ga98bc78188673aae2c4e27b660a3f20fe">cyhal_i2s_event_t</a> event)</div>
<div class="line">{</div>
<div class="line">    <span class="comment">// When we registered the callback, we set &#39;arg&#39; to point to the i2s object</span></div>
<div class="line">    <a class="code hl_struct" href="group__group__hal__impl__hw__types.html#struct__cyhal__audioss__t">cyhal_i2s_t</a>* i2s = (<a class="code hl_struct" href="group__group__hal__impl__hw__types.html#struct__cyhal__audioss__t">cyhal_i2s_t</a>*)arg;</div>
<div class="line">    <span class="keywordflow">if</span> (0u != (event &amp; <a class="code hl_enumvalue" href="group__group__hal__i2s.html#gga98bc78188673aae2c4e27b660a3f20feab4a3a412a6b61efbd39ab540120713e9">CYHAL_I2S_ASYNC_RX_COMPLETE</a>))</div>
<div class="line">    {</div>
<div class="line">        <span class="comment">// Flip the active and the next rx buffers</span></div>
<div class="line">        uint32_t* temp = active_rx_buffer;</div>
<div class="line">        active_rx_buffer = full_rx_buffer;</div>
<div class="line">        full_rx_buffer   = temp;</div>
<div class="line"> </div>
<div class="line">        <span class="comment">// Start reading into the next buffer while the just-filled one is being processed</span></div>
<div class="line">        <a class="code hl_typedef" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a> result = <a class="code hl_function" href="group__group__hal__i2s.html#ga94357835c6f16b979680420f951d8980">cyhal_i2s_read_async</a>(i2s, active_rx_buffer, BUFFER_SIZE);</div>
<div class="line"> </div>
<div class="line">        <span class="keywordflow">if</span> (<a class="code hl_define" href="group__group__result.html#gaf58fac450d9fff4472f03ad68f6e546e">CY_RSLT_SUCCESS</a> == result)</div>
<div class="line">        {</div>
<div class="line">            <span class="comment">// Process the data in the full_rx_buffer</span></div>
<div class="line">        }</div>
<div class="line">    }</div>
<div class="line">}</div>
<div class="line"> </div>
<div class="line"> </div>
<div class="line"><a class="code hl_typedef" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a> snippet_cyhal_i2s_async_receive(<span class="keywordtype">void</span>)</div>
<div class="line">{</div>
<div class="line">    <a class="code hl_struct" href="group__group__hal__impl__hw__types.html#struct__cyhal__audioss__t">cyhal_i2s_t</a> i2s;</div>
<div class="line">    <span class="comment">// Initialize the object as shown in Snippet 1</span></div>
<div class="line"> </div>
<div class="line">    <span class="comment">// Register a callback and set the callback argument to be a pointer to the I2S object, so that</span></div>
<div class="line">    <span class="comment">// we can easily reference it from the callback handler.</span></div>
<div class="line">    <a class="code hl_function" href="group__group__hal__i2s.html#gade0855962b32a1b4d4dbb9bbf9b6354b">cyhal_i2s_register_callback</a>(&amp;i2s, &amp;i2s_event_handler_receive, &amp;i2s);</div>
<div class="line"> </div>
<div class="line">    <span class="comment">// Subscribe to the async complete event so that we can queue up another transfer when this one</span></div>
<div class="line">    <span class="comment">// completes</span></div>
<div class="line">    <a class="code hl_function" href="group__group__hal__i2s.html#gac8adecacf62147f30023e69010b52bf9">cyhal_i2s_enable_event</a>(&amp;i2s, <a class="code hl_enumvalue" href="group__group__hal__i2s.html#gga98bc78188673aae2c4e27b660a3f20feab4a3a412a6b61efbd39ab540120713e9">CYHAL_I2S_ASYNC_RX_COMPLETE</a>, <a class="code hl_define" href="group__group__hal__impl__hw__types.html#gad822a466fc63847114add720ef84c83a">CYHAL_ISR_PRIORITY_DEFAULT</a>, <span class="keyword">true</span>);</div>
<div class="line"> </div>
<div class="line">    <span class="comment">// Configure asynchronous transfers to use DMA to free up the CPU during transfers</span></div>
<div class="line">    <a class="code hl_typedef" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a> result = <a class="code hl_function" href="group__group__hal__i2s.html#ga9fba9ea64bd2ec92a2ae41459020825c">cyhal_i2s_set_async_mode</a>(&amp;i2s, <a class="code hl_enumvalue" href="group__group__hal__general__types.html#ggab2d2acfb82599df54152be0b170c6ec2a580896db2028c77f9f89cb8772a1eb90">CYHAL_ASYNC_DMA</a>, <a class="code hl_define" href="group__group__hal__impl__dma.html#ga81946da56dd6ba8afd28f6056b1d779a">CYHAL_DMA_PRIORITY_DEFAULT</a>);</div>
<div class="line"> </div>
<div class="line">    <span class="keywordflow">if</span> (<a class="code hl_define" href="group__group__result.html#gaf58fac450d9fff4472f03ad68f6e546e">CY_RSLT_SUCCESS</a> == result)</div>
<div class="line">    {</div>
<div class="line">        active_rx_buffer = rx_buffer0;</div>
<div class="line">        full_rx_buffer   = rx_buffer1;</div>
<div class="line">        result           = <a class="code hl_function" href="group__group__hal__i2s.html#ga94357835c6f16b979680420f951d8980">cyhal_i2s_read_async</a>(&amp;i2s, active_rx_buffer, BUFFER_SIZE);</div>
<div class="line">    }</div>
<div class="line"> </div>
<div class="line">    <span class="keywordflow">if</span> (<a class="code hl_define" href="group__group__result.html#gaf58fac450d9fff4472f03ad68f6e546e">CY_RSLT_SUCCESS</a> == result)</div>
<div class="line">    {</div>
<div class="line">        result = <a class="code hl_function" href="group__group__hal__i2s.html#gabc95dd1600db8fdb379e7e7cc3d39039">cyhal_i2s_start_rx</a>(&amp;i2s);</div>
<div class="line">    }</div>
<div class="line"> </div>
<div class="line">    <span class="keywordflow">return</span> result;</div>
<div class="line">}</div>
<div class="line"> </div>
<div class="line"> </div>
<div class="line"><span class="preprocessor">#endif </span><span class="comment">// if defined(CYHAL_DRIVER_AVAILABLE_I2S_RX)</span></div>
<div class="ttc" id="agroup__group__hal__i2s_html_ga94357835c6f16b979680420f951d8980"><div class="ttname"><a href="group__group__hal__i2s.html#ga94357835c6f16b979680420f951d8980">cyhal_i2s_read_async</a></div><div class="ttdeci">cy_rslt_t cyhal_i2s_read_async(cyhal_i2s_t *obj, void *rx, size_t rx_length)</div><div class="ttdoc">Start I2S asynchronous read.</div></div>
<div class="ttc" id="agroup__group__hal__i2s_html_gabc95dd1600db8fdb379e7e7cc3d39039"><div class="ttname"><a href="group__group__hal__i2s.html#gabc95dd1600db8fdb379e7e7cc3d39039">cyhal_i2s_start_rx</a></div><div class="ttdeci">cy_rslt_t cyhal_i2s_start_rx(cyhal_i2s_t *obj)</div><div class="ttdoc">Starts receiving data.</div></div>
<div class="ttc" id="agroup__group__hal__i2s_html_gga98bc78188673aae2c4e27b660a3f20feab4a3a412a6b61efbd39ab540120713e9"><div class="ttname"><a href="group__group__hal__i2s.html#gga98bc78188673aae2c4e27b660a3f20feab4a3a412a6b61efbd39ab540120713e9">CYHAL_I2S_ASYNC_RX_COMPLETE</a></div><div class="ttdeci">@ CYHAL_I2S_ASYNC_RX_COMPLETE</div><div class="ttdoc">Pending async receive is complete.</div><div class="ttdef"><b>Definition:</b> cyhal_i2s.h:167</div></div>
</div><!-- fragment --><h1><a class="anchor" id="subsection_i2s_moreinformation"></a>
More Information</h1>
<p ><b>Code examples (Github)</b></p><ul>
<li><a href="https://github.com/infineon/mtb-example-psoc6-i2s"><b> PSoC™ 6 MCU: Inter-IC Sound (I2S)</b></a></li>
<li><a href="https://github.com/infineon/mtb-example-psoc6-pdm-to-i2s"><b> PSoC™ 6 MCU: PDM to I2S</b></a> </li>
</ul>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="groups" name="groups"></a>
API Reference</h2></td></tr>
<tr class="memitem:group__group__hal__results__i2s"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__results__i2s.html">I2S HAL Results</a></td></tr>
<tr class="memdesc:group__group__hal__results__i2s"><td class="mdescLeft">&#160;</td><td class="mdescRight">I2S specific return codes. <br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="nested-classes" name="nested-classes"></a>
Data Structures</h2></td></tr>
<tr class="memitem:structcyhal__i2s__pins__t"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__i2s.html#structcyhal__i2s__pins__t">cyhal_i2s_pins_t</a></td></tr>
<tr class="memdesc:structcyhal__i2s__pins__t"><td class="mdescLeft">&#160;</td><td class="mdescRight">Pins to use for one I2S direction.  <a href="group__group__hal__i2s.html#structcyhal__i2s__pins__t">More...</a><br /></td></tr>
<tr class="separator:structcyhal__i2s__pins__t"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:structcyhal__i2s__config__t"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__i2s.html#structcyhal__i2s__config__t">cyhal_i2s_config_t</a></td></tr>
<tr class="memdesc:structcyhal__i2s__config__t"><td class="mdescLeft">&#160;</td><td class="mdescRight">I2S Configuration.  <a href="group__group__hal__i2s.html#structcyhal__i2s__config__t">More...</a><br /></td></tr>
<tr class="separator:structcyhal__i2s__config__t"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="typedef-members" name="typedef-members"></a>
Typedefs</h2></td></tr>
<tr class="memitem:ga7c7aa98ff4eb219144157f2af9a9c794"><td class="memItemLeft" align="right" valign="top"><a id="ga7c7aa98ff4eb219144157f2af9a9c794" name="ga7c7aa98ff4eb219144157f2af9a9c794"></a>
typedef void(*&#160;</td><td class="memItemRight" valign="bottom"><b>cyhal_i2s_event_callback_t</b>) (void *callback_arg, <a class="el" href="group__group__hal__i2s.html#ga98bc78188673aae2c4e27b660a3f20fe">cyhal_i2s_event_t</a> event)</td></tr>
<tr class="memdesc:ga7c7aa98ff4eb219144157f2af9a9c794"><td class="mdescLeft">&#160;</td><td class="mdescRight">Handler for I2S event callbacks. <br /></td></tr>
<tr class="separator:ga7c7aa98ff4eb219144157f2af9a9c794"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="enum-members" name="enum-members"></a>
Enumerations</h2></td></tr>
<tr class="memitem:ga98bc78188673aae2c4e27b660a3f20fe"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__i2s.html#ga98bc78188673aae2c4e27b660a3f20fe">cyhal_i2s_event_t</a> { <br />
&#160;&#160;<a class="el" href="group__group__hal__i2s.html#gga98bc78188673aae2c4e27b660a3f20feab3afa80998f12db882eea775c8076b33">CYHAL_I2S_TX_NOT_FULL</a> = 1 &lt;&lt; 0
, <br />
&#160;&#160;<a class="el" href="group__group__hal__i2s.html#gga98bc78188673aae2c4e27b660a3f20feab4ce24b585402763c519a85ffa67cecf">CYHAL_I2S_TX_HALF_EMPTY</a> = 1 &lt;&lt; 1
, <br />
&#160;&#160;<a class="el" href="group__group__hal__i2s.html#gga98bc78188673aae2c4e27b660a3f20feaf860cfe6a5c38f054a44b53f854c8126">CYHAL_I2S_TX_EMPTY</a> = 1 &lt;&lt; 2
, <br />
&#160;&#160;<a class="el" href="group__group__hal__i2s.html#gga98bc78188673aae2c4e27b660a3f20fea3c517acfcb58d72f1fa2dbdf481feed3">CYHAL_I2S_TX_OVERFLOW</a> = 1 &lt;&lt; 3
, <br />
&#160;&#160;<a class="el" href="group__group__hal__i2s.html#gga98bc78188673aae2c4e27b660a3f20fea8f55ed157b1add151bce1e42b1720c81">CYHAL_I2S_TX_UNDERFLOW</a> = 1 &lt;&lt; 4
, <br />
&#160;&#160;<a class="el" href="group__group__hal__i2s.html#gga98bc78188673aae2c4e27b660a3f20fea090269cec878bec745bb2e393606e41e">CYHAL_I2S_ASYNC_TX_COMPLETE</a> = 1 &lt;&lt; 5
, <br />
&#160;&#160;<a class="el" href="group__group__hal__i2s.html#gga98bc78188673aae2c4e27b660a3f20fea5b792c472fda8fe9b0580b48dc3f82cc">CYHAL_I2S_RX_NOT_EMPTY</a> = 1 &lt;&lt; 6
, <br />
&#160;&#160;<a class="el" href="group__group__hal__i2s.html#gga98bc78188673aae2c4e27b660a3f20feaf6a846640d1ecc585d2047f689992c30">CYHAL_I2S_RX_HALF_FULL</a> = 1 &lt;&lt; 7
, <br />
&#160;&#160;<a class="el" href="group__group__hal__i2s.html#gga98bc78188673aae2c4e27b660a3f20feaef9405281e230cb6b518d1649293d3f0">CYHAL_I2S_RX_FULL</a> = 1 &lt;&lt; 8
, <br />
&#160;&#160;<a class="el" href="group__group__hal__i2s.html#gga98bc78188673aae2c4e27b660a3f20fea077892a438ac7297fbfeab8d2a635ff4">CYHAL_I2S_RX_OVERFLOW</a> = 1 &lt;&lt; 9
, <br />
&#160;&#160;<a class="el" href="group__group__hal__i2s.html#gga98bc78188673aae2c4e27b660a3f20fead40a615f2939fbef21deeb6307bc9eb4">CYHAL_I2S_RX_UNDERFLOW</a> = 1 &lt;&lt; 10
, <br />
&#160;&#160;<a class="el" href="group__group__hal__i2s.html#gga98bc78188673aae2c4e27b660a3f20feab4a3a412a6b61efbd39ab540120713e9">CYHAL_I2S_ASYNC_RX_COMPLETE</a> = 1 &lt;&lt; 11
<br />
 }</td></tr>
<tr class="memdesc:ga98bc78188673aae2c4e27b660a3f20fe"><td class="mdescLeft">&#160;</td><td class="mdescRight">I2S events.  <a href="group__group__hal__i2s.html#ga98bc78188673aae2c4e27b660a3f20fe">More...</a><br /></td></tr>
<tr class="separator:ga98bc78188673aae2c4e27b660a3f20fe"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga6f7d46b47e52fa549fed8a8490b10e6e"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__i2s.html#ga6f7d46b47e52fa549fed8a8490b10e6e">cyhal_i2s_output_t</a> { <br />
&#160;&#160;<a class="el" href="group__group__hal__i2s.html#gga6f7d46b47e52fa549fed8a8490b10e6ea2f46dd5c34a77b848a6791670e5ee1a8">CYHAL_I2S_TRIGGER_RX_HALF_FULL</a>
, <br />
&#160;&#160;<a class="el" href="group__group__hal__i2s.html#gga6f7d46b47e52fa549fed8a8490b10e6eaccc8f8bc53b640f2b2b2f96ce03a88a3">CYHAL_I2S_TRIGGER_TX_HALF_EMPTY</a>
<br />
 }</td></tr>
<tr class="memdesc:ga6f7d46b47e52fa549fed8a8490b10e6e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Selections for I2S output signals <br  />
  <a href="group__group__hal__i2s.html#ga6f7d46b47e52fa549fed8a8490b10e6e">More...</a><br /></td></tr>
<tr class="separator:ga6f7d46b47e52fa549fed8a8490b10e6e"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="func-members" name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:gad1008bd6dc716300e3e7d5482390eaf1"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__i2s.html#gad1008bd6dc716300e3e7d5482390eaf1">cyhal_i2s_init</a> (<a class="el" href="group__group__hal__impl__hw__types.html#ga5c90028db813f9efe2a9e95b16caded4">cyhal_i2s_t</a> *obj, const <a class="el" href="group__group__hal__i2s.html#structcyhal__i2s__pins__t">cyhal_i2s_pins_t</a> *tx_pins, const <a class="el" href="group__group__hal__i2s.html#structcyhal__i2s__pins__t">cyhal_i2s_pins_t</a> *rx_pins, const <a class="el" href="group__group__hal__i2s.html#structcyhal__i2s__config__t">cyhal_i2s_config_t</a> *config, <a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__clock__t">cyhal_clock_t</a> *clk)</td></tr>
<tr class="memdesc:gad1008bd6dc716300e3e7d5482390eaf1"><td class="mdescLeft">&#160;</td><td class="mdescRight">Initialize the I2S peripheral.  <a href="group__group__hal__i2s.html#gad1008bd6dc716300e3e7d5482390eaf1">More...</a><br /></td></tr>
<tr class="separator:gad1008bd6dc716300e3e7d5482390eaf1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga061f2ea2ce311e9f36e0a5bde2580cc6"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__i2s.html#ga061f2ea2ce311e9f36e0a5bde2580cc6">cyhal_i2s_init_cfg</a> (<a class="el" href="group__group__hal__impl__hw__types.html#ga5c90028db813f9efe2a9e95b16caded4">cyhal_i2s_t</a> *obj, const <a class="el" href="group__group__hal__impl__hw__types.html#ga9264445fa8d36d0ddaeb59931073ccd0">cyhal_i2s_configurator_t</a> *cfg)</td></tr>
<tr class="memdesc:ga061f2ea2ce311e9f36e0a5bde2580cc6"><td class="mdescLeft">&#160;</td><td class="mdescRight">Initialize the I2S peripheral using a configurator generated configuration struct.  <a href="group__group__hal__i2s.html#ga061f2ea2ce311e9f36e0a5bde2580cc6">More...</a><br /></td></tr>
<tr class="separator:ga061f2ea2ce311e9f36e0a5bde2580cc6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gabda3b41391e8567f52599268dd6b721e"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__i2s.html#gabda3b41391e8567f52599268dd6b721e">cyhal_i2s_free</a> (<a class="el" href="group__group__hal__impl__hw__types.html#ga5c90028db813f9efe2a9e95b16caded4">cyhal_i2s_t</a> *obj)</td></tr>
<tr class="memdesc:gabda3b41391e8567f52599268dd6b721e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Deinitialize the i2s object.  <a href="group__group__hal__i2s.html#gabda3b41391e8567f52599268dd6b721e">More...</a><br /></td></tr>
<tr class="separator:gabda3b41391e8567f52599268dd6b721e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga1bb2c6da52278fc4f4c4558846bfa20a"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__i2s.html#ga1bb2c6da52278fc4f4c4558846bfa20a">cyhal_i2s_set_sample_rate</a> (<a class="el" href="group__group__hal__impl__hw__types.html#ga5c90028db813f9efe2a9e95b16caded4">cyhal_i2s_t</a> *obj, uint32_t sample_rate_hz)</td></tr>
<tr class="memdesc:ga1bb2c6da52278fc4f4c4558846bfa20a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set the I2S sample rate.  <a href="group__group__hal__i2s.html#ga1bb2c6da52278fc4f4c4558846bfa20a">More...</a><br /></td></tr>
<tr class="separator:ga1bb2c6da52278fc4f4c4558846bfa20a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gabe95fc12ff1d9264a60e8eeda35d885a"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__i2s.html#gabe95fc12ff1d9264a60e8eeda35d885a">cyhal_i2s_start_tx</a> (<a class="el" href="group__group__hal__impl__hw__types.html#ga5c90028db813f9efe2a9e95b16caded4">cyhal_i2s_t</a> *obj)</td></tr>
<tr class="memdesc:gabe95fc12ff1d9264a60e8eeda35d885a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Starts transmitting data.  <a href="group__group__hal__i2s.html#gabe95fc12ff1d9264a60e8eeda35d885a">More...</a><br /></td></tr>
<tr class="separator:gabe95fc12ff1d9264a60e8eeda35d885a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gae809b73f16e9dbc25e12c0c2687e1ba0"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__i2s.html#gae809b73f16e9dbc25e12c0c2687e1ba0">cyhal_i2s_stop_tx</a> (<a class="el" href="group__group__hal__impl__hw__types.html#ga5c90028db813f9efe2a9e95b16caded4">cyhal_i2s_t</a> *obj)</td></tr>
<tr class="memdesc:gae809b73f16e9dbc25e12c0c2687e1ba0"><td class="mdescLeft">&#160;</td><td class="mdescRight">Stops transmitting data.  <a href="group__group__hal__i2s.html#gae809b73f16e9dbc25e12c0c2687e1ba0">More...</a><br /></td></tr>
<tr class="separator:gae809b73f16e9dbc25e12c0c2687e1ba0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga5b0c26d3c1193984873cfd1970287bdc"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__i2s.html#ga5b0c26d3c1193984873cfd1970287bdc">cyhal_i2s_clear_tx</a> (<a class="el" href="group__group__hal__impl__hw__types.html#ga5c90028db813f9efe2a9e95b16caded4">cyhal_i2s_t</a> *obj)</td></tr>
<tr class="memdesc:ga5b0c26d3c1193984873cfd1970287bdc"><td class="mdescLeft">&#160;</td><td class="mdescRight">Clears the tx hardware buffer.  <a href="group__group__hal__i2s.html#ga5b0c26d3c1193984873cfd1970287bdc">More...</a><br /></td></tr>
<tr class="separator:ga5b0c26d3c1193984873cfd1970287bdc"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gabc95dd1600db8fdb379e7e7cc3d39039"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__i2s.html#gabc95dd1600db8fdb379e7e7cc3d39039">cyhal_i2s_start_rx</a> (<a class="el" href="group__group__hal__impl__hw__types.html#ga5c90028db813f9efe2a9e95b16caded4">cyhal_i2s_t</a> *obj)</td></tr>
<tr class="memdesc:gabc95dd1600db8fdb379e7e7cc3d39039"><td class="mdescLeft">&#160;</td><td class="mdescRight">Starts receiving data.  <a href="group__group__hal__i2s.html#gabc95dd1600db8fdb379e7e7cc3d39039">More...</a><br /></td></tr>
<tr class="separator:gabc95dd1600db8fdb379e7e7cc3d39039"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gad76c51ccedc76681490c74e7d859ee8a"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__i2s.html#gad76c51ccedc76681490c74e7d859ee8a">cyhal_i2s_stop_rx</a> (<a class="el" href="group__group__hal__impl__hw__types.html#ga5c90028db813f9efe2a9e95b16caded4">cyhal_i2s_t</a> *obj)</td></tr>
<tr class="memdesc:gad76c51ccedc76681490c74e7d859ee8a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Stops receiving data.  <a href="group__group__hal__i2s.html#gad76c51ccedc76681490c74e7d859ee8a">More...</a><br /></td></tr>
<tr class="separator:gad76c51ccedc76681490c74e7d859ee8a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga0e0d62ba6e2038bd7c45b8c9cbdea88d"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__i2s.html#ga0e0d62ba6e2038bd7c45b8c9cbdea88d">cyhal_i2s_clear_rx</a> (<a class="el" href="group__group__hal__impl__hw__types.html#ga5c90028db813f9efe2a9e95b16caded4">cyhal_i2s_t</a> *obj)</td></tr>
<tr class="memdesc:ga0e0d62ba6e2038bd7c45b8c9cbdea88d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Clears the rx hardware buffer.  <a href="group__group__hal__i2s.html#ga0e0d62ba6e2038bd7c45b8c9cbdea88d">More...</a><br /></td></tr>
<tr class="separator:ga0e0d62ba6e2038bd7c45b8c9cbdea88d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga29f8aaf72795492ac915dbddc0353c4c"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__i2s.html#ga29f8aaf72795492ac915dbddc0353c4c">cyhal_i2s_read</a> (<a class="el" href="group__group__hal__impl__hw__types.html#ga5c90028db813f9efe2a9e95b16caded4">cyhal_i2s_t</a> *obj, void *data, size_t *length)</td></tr>
<tr class="memdesc:ga29f8aaf72795492ac915dbddc0353c4c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Read data synchronously.  <a href="group__group__hal__i2s.html#ga29f8aaf72795492ac915dbddc0353c4c">More...</a><br /></td></tr>
<tr class="separator:ga29f8aaf72795492ac915dbddc0353c4c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga5362911702d7ab8687107159fb6a07e6"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__i2s.html#ga5362911702d7ab8687107159fb6a07e6">cyhal_i2s_write</a> (<a class="el" href="group__group__hal__impl__hw__types.html#ga5c90028db813f9efe2a9e95b16caded4">cyhal_i2s_t</a> *obj, const void *data, size_t *length)</td></tr>
<tr class="memdesc:ga5362911702d7ab8687107159fb6a07e6"><td class="mdescLeft">&#160;</td><td class="mdescRight">Send data synchronously.  <a href="group__group__hal__i2s.html#ga5362911702d7ab8687107159fb6a07e6">More...</a><br /></td></tr>
<tr class="separator:ga5362911702d7ab8687107159fb6a07e6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga6d036772b1ab51351907de2b1da7b8e4"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__i2s.html#ga6d036772b1ab51351907de2b1da7b8e4">cyhal_i2s_is_tx_enabled</a> (<a class="el" href="group__group__hal__impl__hw__types.html#ga5c90028db813f9efe2a9e95b16caded4">cyhal_i2s_t</a> *obj)</td></tr>
<tr class="memdesc:ga6d036772b1ab51351907de2b1da7b8e4"><td class="mdescLeft">&#160;</td><td class="mdescRight">Checks if the transmit functionality is enabled for the specified I2S peripheral (regardless of whether data is currently queued for transmission).  <a href="group__group__hal__i2s.html#ga6d036772b1ab51351907de2b1da7b8e4">More...</a><br /></td></tr>
<tr class="separator:ga6d036772b1ab51351907de2b1da7b8e4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga7204d762c6cff08d79916e12e66848b2"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__i2s.html#ga7204d762c6cff08d79916e12e66848b2">cyhal_i2s_is_tx_busy</a> (<a class="el" href="group__group__hal__impl__hw__types.html#ga5c90028db813f9efe2a9e95b16caded4">cyhal_i2s_t</a> *obj)</td></tr>
<tr class="memdesc:ga7204d762c6cff08d79916e12e66848b2"><td class="mdescLeft">&#160;</td><td class="mdescRight">Checks if the specified I2S peripheral is transmitting data, including if a pending async transfer is waiting to write more data to the transmit buffer.  <a href="group__group__hal__i2s.html#ga7204d762c6cff08d79916e12e66848b2">More...</a><br /></td></tr>
<tr class="separator:ga7204d762c6cff08d79916e12e66848b2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gae5cbf3706ddde3acc4852025887190ba"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__i2s.html#gae5cbf3706ddde3acc4852025887190ba">cyhal_i2s_is_rx_enabled</a> (<a class="el" href="group__group__hal__impl__hw__types.html#ga5c90028db813f9efe2a9e95b16caded4">cyhal_i2s_t</a> *obj)</td></tr>
<tr class="memdesc:gae5cbf3706ddde3acc4852025887190ba"><td class="mdescLeft">&#160;</td><td class="mdescRight">Checks if the receive functionality is enabled for the specified I2S peripheral (regardless of whether any unread data has been received).  <a href="group__group__hal__i2s.html#gae5cbf3706ddde3acc4852025887190ba">More...</a><br /></td></tr>
<tr class="separator:gae5cbf3706ddde3acc4852025887190ba"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga636ca3ae4d499af1c99af59bddf19166"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__i2s.html#ga636ca3ae4d499af1c99af59bddf19166">cyhal_i2s_is_rx_busy</a> (<a class="el" href="group__group__hal__impl__hw__types.html#ga5c90028db813f9efe2a9e95b16caded4">cyhal_i2s_t</a> *obj)</td></tr>
<tr class="memdesc:ga636ca3ae4d499af1c99af59bddf19166"><td class="mdescLeft">&#160;</td><td class="mdescRight">Checks if the specified I2S peripheral has received data that has not yet been read out of the hardware buffer.  <a href="group__group__hal__i2s.html#ga636ca3ae4d499af1c99af59bddf19166">More...</a><br /></td></tr>
<tr class="separator:ga636ca3ae4d499af1c99af59bddf19166"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga94357835c6f16b979680420f951d8980"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__i2s.html#ga94357835c6f16b979680420f951d8980">cyhal_i2s_read_async</a> (<a class="el" href="group__group__hal__impl__hw__types.html#ga5c90028db813f9efe2a9e95b16caded4">cyhal_i2s_t</a> *obj, void *rx, size_t rx_length)</td></tr>
<tr class="memdesc:ga94357835c6f16b979680420f951d8980"><td class="mdescLeft">&#160;</td><td class="mdescRight">Start I2S asynchronous read.  <a href="group__group__hal__i2s.html#ga94357835c6f16b979680420f951d8980">More...</a><br /></td></tr>
<tr class="separator:ga94357835c6f16b979680420f951d8980"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga5f4dd73de0bd46bee15d82fe793f5ca3"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__i2s.html#ga5f4dd73de0bd46bee15d82fe793f5ca3">cyhal_i2s_write_async</a> (<a class="el" href="group__group__hal__impl__hw__types.html#ga5c90028db813f9efe2a9e95b16caded4">cyhal_i2s_t</a> *obj, const void *tx, size_t tx_length)</td></tr>
<tr class="memdesc:ga5f4dd73de0bd46bee15d82fe793f5ca3"><td class="mdescLeft">&#160;</td><td class="mdescRight">Start I2S asynchronous write.  <a href="group__group__hal__i2s.html#ga5f4dd73de0bd46bee15d82fe793f5ca3">More...</a><br /></td></tr>
<tr class="separator:ga5f4dd73de0bd46bee15d82fe793f5ca3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga9fba9ea64bd2ec92a2ae41459020825c"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__i2s.html#ga9fba9ea64bd2ec92a2ae41459020825c">cyhal_i2s_set_async_mode</a> (<a class="el" href="group__group__hal__impl__hw__types.html#ga5c90028db813f9efe2a9e95b16caded4">cyhal_i2s_t</a> *obj, <a class="el" href="group__group__hal__general__types.html#gab2d2acfb82599df54152be0b170c6ec2">cyhal_async_mode_t</a> mode, uint8_t dma_priority)</td></tr>
<tr class="memdesc:ga9fba9ea64bd2ec92a2ae41459020825c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set the mechanism that is used to perform I2S asynchronous transfers.  <a href="group__group__hal__i2s.html#ga9fba9ea64bd2ec92a2ae41459020825c">More...</a><br /></td></tr>
<tr class="separator:ga9fba9ea64bd2ec92a2ae41459020825c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga9ee30034685c4559212a5180ecfac7dc"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__i2s.html#ga9ee30034685c4559212a5180ecfac7dc">cyhal_i2s_is_read_pending</a> (<a class="el" href="group__group__hal__impl__hw__types.html#ga5c90028db813f9efe2a9e95b16caded4">cyhal_i2s_t</a> *obj)</td></tr>
<tr class="memdesc:ga9ee30034685c4559212a5180ecfac7dc"><td class="mdescLeft">&#160;</td><td class="mdescRight">Checks if the specified I2S peripheral is in the process of reading data from the hardware buffer into RAM.  <a href="group__group__hal__i2s.html#ga9ee30034685c4559212a5180ecfac7dc">More...</a><br /></td></tr>
<tr class="separator:ga9ee30034685c4559212a5180ecfac7dc"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga3e151230ed3442aed1295ee2a3d8e8bf"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__i2s.html#ga3e151230ed3442aed1295ee2a3d8e8bf">cyhal_i2s_is_write_pending</a> (<a class="el" href="group__group__hal__impl__hw__types.html#ga5c90028db813f9efe2a9e95b16caded4">cyhal_i2s_t</a> *obj)</td></tr>
<tr class="memdesc:ga3e151230ed3442aed1295ee2a3d8e8bf"><td class="mdescLeft">&#160;</td><td class="mdescRight">Checks if the specified I2S peripheral is in the process of writing data into the hardware buffer.  <a href="group__group__hal__i2s.html#ga3e151230ed3442aed1295ee2a3d8e8bf">More...</a><br /></td></tr>
<tr class="separator:ga3e151230ed3442aed1295ee2a3d8e8bf"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga9d755179f6a38da673df11331541e2e6"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__i2s.html#ga9d755179f6a38da673df11331541e2e6">cyhal_i2s_abort_read_async</a> (<a class="el" href="group__group__hal__impl__hw__types.html#ga5c90028db813f9efe2a9e95b16caded4">cyhal_i2s_t</a> *obj)</td></tr>
<tr class="memdesc:ga9d755179f6a38da673df11331541e2e6"><td class="mdescLeft">&#160;</td><td class="mdescRight">Abort I2S asynchronous read.  <a href="group__group__hal__i2s.html#ga9d755179f6a38da673df11331541e2e6">More...</a><br /></td></tr>
<tr class="separator:ga9d755179f6a38da673df11331541e2e6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaf15b5df60f51c5678931e06ddb3c9fb6"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__i2s.html#gaf15b5df60f51c5678931e06ddb3c9fb6">cyhal_i2s_abort_write_async</a> (<a class="el" href="group__group__hal__impl__hw__types.html#ga5c90028db813f9efe2a9e95b16caded4">cyhal_i2s_t</a> *obj)</td></tr>
<tr class="memdesc:gaf15b5df60f51c5678931e06ddb3c9fb6"><td class="mdescLeft">&#160;</td><td class="mdescRight">Abort I2S asynchronous write.  <a href="group__group__hal__i2s.html#gaf15b5df60f51c5678931e06ddb3c9fb6">More...</a><br /></td></tr>
<tr class="separator:gaf15b5df60f51c5678931e06ddb3c9fb6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gade0855962b32a1b4d4dbb9bbf9b6354b"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__i2s.html#gade0855962b32a1b4d4dbb9bbf9b6354b">cyhal_i2s_register_callback</a> (<a class="el" href="group__group__hal__impl__hw__types.html#ga5c90028db813f9efe2a9e95b16caded4">cyhal_i2s_t</a> *obj, <a class="el" href="group__group__hal__i2s.html#ga7c7aa98ff4eb219144157f2af9a9c794">cyhal_i2s_event_callback_t</a> callback, void *callback_arg)</td></tr>
<tr class="memdesc:gade0855962b32a1b4d4dbb9bbf9b6354b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Register an I2S callback handler.  <a href="group__group__hal__i2s.html#gade0855962b32a1b4d4dbb9bbf9b6354b">More...</a><br /></td></tr>
<tr class="separator:gade0855962b32a1b4d4dbb9bbf9b6354b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gac8adecacf62147f30023e69010b52bf9"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__i2s.html#gac8adecacf62147f30023e69010b52bf9">cyhal_i2s_enable_event</a> (<a class="el" href="group__group__hal__impl__hw__types.html#ga5c90028db813f9efe2a9e95b16caded4">cyhal_i2s_t</a> *obj, <a class="el" href="group__group__hal__i2s.html#ga98bc78188673aae2c4e27b660a3f20fe">cyhal_i2s_event_t</a> event, uint8_t intr_priority, bool enable)</td></tr>
<tr class="memdesc:gac8adecacf62147f30023e69010b52bf9"><td class="mdescLeft">&#160;</td><td class="mdescRight">Configure I2S events.  <a href="group__group__hal__i2s.html#gac8adecacf62147f30023e69010b52bf9">More...</a><br /></td></tr>
<tr class="separator:gac8adecacf62147f30023e69010b52bf9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gabdfe29741f8040cf92d99fad53195af5"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__i2s.html#gabdfe29741f8040cf92d99fad53195af5">cyhal_i2s_enable_output</a> (<a class="el" href="group__group__hal__impl__hw__types.html#ga5c90028db813f9efe2a9e95b16caded4">cyhal_i2s_t</a> *obj, <a class="el" href="group__group__hal__i2s.html#ga6f7d46b47e52fa549fed8a8490b10e6e">cyhal_i2s_output_t</a> output, <a class="el" href="group__group__hal__impl__triggers__psoc6__01.html#ga96236d1368f920d28af90262e8b57046">cyhal_source_t</a> *source)</td></tr>
<tr class="memdesc:gabdfe29741f8040cf92d99fad53195af5"><td class="mdescLeft">&#160;</td><td class="mdescRight">Enables the specified output signal.  <a href="group__group__hal__i2s.html#gabdfe29741f8040cf92d99fad53195af5">More...</a><br /></td></tr>
<tr class="separator:gabdfe29741f8040cf92d99fad53195af5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gae9a3a32cb4292687b2ff2bca54d29b62"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__i2s.html#gae9a3a32cb4292687b2ff2bca54d29b62">cyhal_i2s_disable_output</a> (<a class="el" href="group__group__hal__impl__hw__types.html#ga5c90028db813f9efe2a9e95b16caded4">cyhal_i2s_t</a> *obj, <a class="el" href="group__group__hal__i2s.html#ga6f7d46b47e52fa549fed8a8490b10e6e">cyhal_i2s_output_t</a> output)</td></tr>
<tr class="memdesc:gae9a3a32cb4292687b2ff2bca54d29b62"><td class="mdescLeft">&#160;</td><td class="mdescRight">Disables the specified output signal.  <a href="group__group__hal__i2s.html#gae9a3a32cb4292687b2ff2bca54d29b62">More...</a><br /></td></tr>
<tr class="separator:gae9a3a32cb4292687b2ff2bca54d29b62"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<hr/><h2 class="groupheader">Data Structure Documentation</h2>
<a name="structcyhal__i2s__pins__t" id="structcyhal__i2s__pins__t"></a>
<h2 class="memtitle"><span class="permalink"><a href="#structcyhal__i2s__pins__t">&#9670;&nbsp;</a></span>cyhal_i2s_pins_t</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">struct cyhal_i2s_pins_t</td>
        </tr>
      </table>
</div><div class="memdoc">
<table class="fieldtable">
<tr><th colspan="3">Data Fields</th></tr>
<tr><td class="fieldtype">
<a id="a06f418e1a73780daacabb034e78ad0d9" name="a06f418e1a73780daacabb034e78ad0d9"></a><a class="el" href="group__group__hal__impl__pin__package__psoc6__01__104__m__csp__ble.html#ga707195ce0627016bf371643bdd9caa51">cyhal_gpio_t</a></td>
<td class="fieldname">
sck</td>
<td class="fielddoc">
Clock pin. </td></tr>
<tr><td class="fieldtype">
<a id="ac1888b4fa0b934f7c48598ced0fc5ba5" name="ac1888b4fa0b934f7c48598ced0fc5ba5"></a><a class="el" href="group__group__hal__impl__pin__package__psoc6__01__104__m__csp__ble.html#ga707195ce0627016bf371643bdd9caa51">cyhal_gpio_t</a></td>
<td class="fieldname">
ws</td>
<td class="fielddoc">
Word select. </td></tr>
<tr><td class="fieldtype">
<a id="a9b80d91c0f3aa4d02905351de66016c4" name="a9b80d91c0f3aa4d02905351de66016c4"></a><a class="el" href="group__group__hal__impl__pin__package__psoc6__01__104__m__csp__ble.html#ga707195ce0627016bf371643bdd9caa51">cyhal_gpio_t</a></td>
<td class="fieldname">
data</td>
<td class="fielddoc">
Data pin (sdo or sdi) </td></tr>
<tr><td class="fieldtype">
<a id="a97777388c9c2f217e93ce3dcee2f0e91" name="a97777388c9c2f217e93ce3dcee2f0e91"></a><a class="el" href="group__group__hal__impl__pin__package__psoc6__01__104__m__csp__ble.html#ga707195ce0627016bf371643bdd9caa51">cyhal_gpio_t</a></td>
<td class="fieldname">
mclk</td>
<td class="fielddoc">
Mclk input pin. Set to NC if an internal clock source should be used. </td></tr>
</table>

</div>
</div>
<a name="structcyhal__i2s__config__t" id="structcyhal__i2s__config__t"></a>
<h2 class="memtitle"><span class="permalink"><a href="#structcyhal__i2s__config__t">&#9670;&nbsp;</a></span>cyhal_i2s_config_t</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">struct cyhal_i2s_config_t</td>
        </tr>
      </table>
</div><div class="memdoc">
<table class="fieldtable">
<tr><th colspan="3">Data Fields</th></tr>
<tr><td class="fieldtype">
<a id="aa83c7a4b2a6f43a7ef74ad0d23c6546c" name="aa83c7a4b2a6f43a7ef74ad0d23c6546c"></a>bool</td>
<td class="fieldname">
is_tx_slave</td>
<td class="fielddoc">
Configure TX to operate a slave (true) or master (false) </td></tr>
<tr><td class="fieldtype">
<a id="ab97a618e5f752ff584d3741fbfdc3b59" name="ab97a618e5f752ff584d3741fbfdc3b59"></a>bool</td>
<td class="fieldname">
is_rx_slave</td>
<td class="fielddoc">
Configure RX to operate a slave (true) or master (false) </td></tr>
<tr><td class="fieldtype">
<a id="a7db6bfa0aa848075911b43f9e2d41801" name="a7db6bfa0aa848075911b43f9e2d41801"></a>uint32_t</td>
<td class="fieldname">
mclk_hz</td>
<td class="fielddoc">
Frequency, in hertz, of the master clock if it is provided by an external pin. <p >If at least one mclk pin is not NC, this must be nonzero. If both mclk pins are NC, this must be zero. </p>
</td></tr>
<tr><td class="fieldtype">
<a id="abec410733e0694bbfa7b720bffe0b1d3" name="abec410733e0694bbfa7b720bffe0b1d3"></a>uint8_t</td>
<td class="fieldname">
channel_length</td>
<td class="fielddoc">
Number of bits in each channel. <p >See the implementation specific documentation for supported values. </p>
</td></tr>
<tr><td class="fieldtype">
<a id="af516514096f1a20028012346b78648ce" name="af516514096f1a20028012346b78648ce"></a>uint8_t</td>
<td class="fieldname">
word_length</td>
<td class="fielddoc">
Number of bits in each word. <p >Must be less than or equal to channel_length. If word_length &lt; channel_length, the excess bits will be padded with 0's. </p>
</td></tr>
<tr><td class="fieldtype">
<a id="ad75c9325dc3afac6d866b7a3f7ca8245" name="ad75c9325dc3afac6d866b7a3f7ca8245"></a>uint32_t</td>
<td class="fieldname">
sample_rate_hz</td>
<td class="fielddoc">
Sample rate in Hz. </td></tr>
</table>

</div>
</div>
<h2 class="groupheader">Enumeration Type Documentation</h2>
<a id="ga98bc78188673aae2c4e27b660a3f20fe" name="ga98bc78188673aae2c4e27b660a3f20fe"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga98bc78188673aae2c4e27b660a3f20fe">&#9670;&nbsp;</a></span>cyhal_i2s_event_t</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="group__group__hal__i2s.html#ga98bc78188673aae2c4e27b660a3f20fe">cyhal_i2s_event_t</a></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>I2S events. </p>
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a id="gga98bc78188673aae2c4e27b660a3f20feab3afa80998f12db882eea775c8076b33" name="gga98bc78188673aae2c4e27b660a3f20feab3afa80998f12db882eea775c8076b33"></a>CYHAL_I2S_TX_NOT_FULL&#160;</td><td class="fielddoc"><p >TX HW Buffer is not full. </p>
</td></tr>
<tr><td class="fieldname"><a id="gga98bc78188673aae2c4e27b660a3f20feab4ce24b585402763c519a85ffa67cecf" name="gga98bc78188673aae2c4e27b660a3f20feab4ce24b585402763c519a85ffa67cecf"></a>CYHAL_I2S_TX_HALF_EMPTY&#160;</td><td class="fielddoc"><p >TX HW Buffer is half empty. </p>
</td></tr>
<tr><td class="fieldname"><a id="gga98bc78188673aae2c4e27b660a3f20feaf860cfe6a5c38f054a44b53f854c8126" name="gga98bc78188673aae2c4e27b660a3f20feaf860cfe6a5c38f054a44b53f854c8126"></a>CYHAL_I2S_TX_EMPTY&#160;</td><td class="fielddoc"><p >TX HW Buffer is Empty. </p>
</td></tr>
<tr><td class="fieldname"><a id="gga98bc78188673aae2c4e27b660a3f20fea3c517acfcb58d72f1fa2dbdf481feed3" name="gga98bc78188673aae2c4e27b660a3f20fea3c517acfcb58d72f1fa2dbdf481feed3"></a>CYHAL_I2S_TX_OVERFLOW&#160;</td><td class="fielddoc"><p >Attempt to write when TX HW Buffer is full. </p>
</td></tr>
<tr><td class="fieldname"><a id="gga98bc78188673aae2c4e27b660a3f20fea8f55ed157b1add151bce1e42b1720c81" name="gga98bc78188673aae2c4e27b660a3f20fea8f55ed157b1add151bce1e42b1720c81"></a>CYHAL_I2S_TX_UNDERFLOW&#160;</td><td class="fielddoc"><p >Interface ready to transfer data but HW TX buffer is empty. </p>
</td></tr>
<tr><td class="fieldname"><a id="gga98bc78188673aae2c4e27b660a3f20fea090269cec878bec745bb2e393606e41e" name="gga98bc78188673aae2c4e27b660a3f20fea090269cec878bec745bb2e393606e41e"></a>CYHAL_I2S_ASYNC_TX_COMPLETE&#160;</td><td class="fielddoc"><p >Pending async transmit is complete (but the HW buffer may still contain unsent data) </p>
</td></tr>
<tr><td class="fieldname"><a id="gga98bc78188673aae2c4e27b660a3f20fea5b792c472fda8fe9b0580b48dc3f82cc" name="gga98bc78188673aae2c4e27b660a3f20fea5b792c472fda8fe9b0580b48dc3f82cc"></a>CYHAL_I2S_RX_NOT_EMPTY&#160;</td><td class="fielddoc"><p >RX HW Buffer is not Empty. </p>
</td></tr>
<tr><td class="fieldname"><a id="gga98bc78188673aae2c4e27b660a3f20feaf6a846640d1ecc585d2047f689992c30" name="gga98bc78188673aae2c4e27b660a3f20feaf6a846640d1ecc585d2047f689992c30"></a>CYHAL_I2S_RX_HALF_FULL&#160;</td><td class="fielddoc"><p >RX HW Buffer is half full. </p>
</td></tr>
<tr><td class="fieldname"><a id="gga98bc78188673aae2c4e27b660a3f20feaef9405281e230cb6b518d1649293d3f0" name="gga98bc78188673aae2c4e27b660a3f20feaef9405281e230cb6b518d1649293d3f0"></a>CYHAL_I2S_RX_FULL&#160;</td><td class="fielddoc"><p >RX HW Buffer is FULL. </p>
</td></tr>
<tr><td class="fieldname"><a id="gga98bc78188673aae2c4e27b660a3f20fea077892a438ac7297fbfeab8d2a635ff4" name="gga98bc78188673aae2c4e27b660a3f20fea077892a438ac7297fbfeab8d2a635ff4"></a>CYHAL_I2S_RX_OVERFLOW&#160;</td><td class="fielddoc"><p >Attempt to write when RX HW Buffer is full. </p>
</td></tr>
<tr><td class="fieldname"><a id="gga98bc78188673aae2c4e27b660a3f20fead40a615f2939fbef21deeb6307bc9eb4" name="gga98bc78188673aae2c4e27b660a3f20fead40a615f2939fbef21deeb6307bc9eb4"></a>CYHAL_I2S_RX_UNDERFLOW&#160;</td><td class="fielddoc"><p >Attempt to read when HW RX buffer is empty. </p>
</td></tr>
<tr><td class="fieldname"><a id="gga98bc78188673aae2c4e27b660a3f20feab4a3a412a6b61efbd39ab540120713e9" name="gga98bc78188673aae2c4e27b660a3f20feab4a3a412a6b61efbd39ab540120713e9"></a>CYHAL_I2S_ASYNC_RX_COMPLETE&#160;</td><td class="fielddoc"><p >Pending async receive is complete. </p>
</td></tr>
</table>

</div>
</div>
<a id="ga6f7d46b47e52fa549fed8a8490b10e6e" name="ga6f7d46b47e52fa549fed8a8490b10e6e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga6f7d46b47e52fa549fed8a8490b10e6e">&#9670;&nbsp;</a></span>cyhal_i2s_output_t</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="group__group__hal__i2s.html#ga6f7d46b47e52fa549fed8a8490b10e6e">cyhal_i2s_output_t</a></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Selections for I2S output signals <br  />
 </p>
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a id="gga6f7d46b47e52fa549fed8a8490b10e6ea2f46dd5c34a77b848a6791670e5ee1a8" name="gga6f7d46b47e52fa549fed8a8490b10e6ea2f46dd5c34a77b848a6791670e5ee1a8"></a>CYHAL_I2S_TRIGGER_RX_HALF_FULL&#160;</td><td class="fielddoc"><p >An output signal should be triggered when the receive buffer is half full. </p>
</td></tr>
<tr><td class="fieldname"><a id="gga6f7d46b47e52fa549fed8a8490b10e6eaccc8f8bc53b640f2b2b2f96ce03a88a3" name="gga6f7d46b47e52fa549fed8a8490b10e6eaccc8f8bc53b640f2b2b2f96ce03a88a3"></a>CYHAL_I2S_TRIGGER_TX_HALF_EMPTY&#160;</td><td class="fielddoc"><p >An output signal should be triggered when the transmit buffer is half empty. </p>
</td></tr>
</table>

</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a id="gad1008bd6dc716300e3e7d5482390eaf1" name="gad1008bd6dc716300e3e7d5482390eaf1"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gad1008bd6dc716300e3e7d5482390eaf1">&#9670;&nbsp;</a></span>cyhal_i2s_init()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a> cyhal_i2s_init </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__hal__impl__hw__types.html#ga5c90028db813f9efe2a9e95b16caded4">cyhal_i2s_t</a> *&#160;</td>
          <td class="paramname"><em>obj</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="group__group__hal__i2s.html#structcyhal__i2s__pins__t">cyhal_i2s_pins_t</a> *&#160;</td>
          <td class="paramname"><em>tx_pins</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="group__group__hal__i2s.html#structcyhal__i2s__pins__t">cyhal_i2s_pins_t</a> *&#160;</td>
          <td class="paramname"><em>rx_pins</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="group__group__hal__i2s.html#structcyhal__i2s__config__t">cyhal_i2s_config_t</a> *&#160;</td>
          <td class="paramname"><em>config</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__clock__t">cyhal_clock_t</a> *&#160;</td>
          <td class="paramname"><em>clk</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Initialize the I2S peripheral. </p>
<p >It sets the default parameters for I2S peripheral, and configures its specifieds pins. If only one direction is to be used, then the pins for the other direction need not be specified (i.e. they may be set to NC). For example, if only RX is needed, tx_sck, tx_ws, and tx_sdo may all be set to NC. If one pin is specified for a direction, all pins for that direction must be specified.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[out]</td><td class="paramname">obj</td><td>Pointer to an I2S object. The caller must allocate the memory for this object but the init function will initialize its contents. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">tx_pins</td><td>Pins for I2S transmit. If NULL, transmit functionality will be disabled. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">rx_pins</td><td>Pins for I2S receive. If NULL, receive functionality will be disabled. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">config</td><td>Initial block configuration </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">clk</td><td>Clock source to use for this instance. If NULL, a dedicated clock divider will be allocated for this instance. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The status of the init request </dd></dl>

</div>
</div>
<a id="ga061f2ea2ce311e9f36e0a5bde2580cc6" name="ga061f2ea2ce311e9f36e0a5bde2580cc6"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga061f2ea2ce311e9f36e0a5bde2580cc6">&#9670;&nbsp;</a></span>cyhal_i2s_init_cfg()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a> cyhal_i2s_init_cfg </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__hal__impl__hw__types.html#ga5c90028db813f9efe2a9e95b16caded4">cyhal_i2s_t</a> *&#160;</td>
          <td class="paramname"><em>obj</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="group__group__hal__impl__hw__types.html#ga9264445fa8d36d0ddaeb59931073ccd0">cyhal_i2s_configurator_t</a> *&#160;</td>
          <td class="paramname"><em>cfg</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Initialize the I2S peripheral using a configurator generated configuration struct. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[out]</td><td class="paramname">obj</td><td>Pointer to a I2S object. The caller must allocate the memory for this object but the init function will initialize its contents. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">cfg</td><td>Configuration structure generated by a configurator. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The status of the init request </dd></dl>

</div>
</div>
<a id="gabda3b41391e8567f52599268dd6b721e" name="gabda3b41391e8567f52599268dd6b721e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gabda3b41391e8567f52599268dd6b721e">&#9670;&nbsp;</a></span>cyhal_i2s_free()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void cyhal_i2s_free </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__hal__impl__hw__types.html#ga5c90028db813f9efe2a9e95b16caded4">cyhal_i2s_t</a> *&#160;</td>
          <td class="paramname"><em>obj</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Deinitialize the i2s object. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in,out]</td><td class="paramname">obj</td><td>The i2s object </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="ga1bb2c6da52278fc4f4c4558846bfa20a" name="ga1bb2c6da52278fc4f4c4558846bfa20a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga1bb2c6da52278fc4f4c4558846bfa20a">&#9670;&nbsp;</a></span>cyhal_i2s_set_sample_rate()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a> cyhal_i2s_set_sample_rate </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__hal__impl__hw__types.html#ga5c90028db813f9efe2a9e95b16caded4">cyhal_i2s_t</a> *&#160;</td>
          <td class="paramname"><em>obj</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>sample_rate_hz</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Set the I2S sample rate. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">obj</td><td>The I2S object </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">sample_rate_hz</td><td>Sample rate in Hz </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The status of the set sample rate request </dd></dl>

</div>
</div>
<a id="gabe95fc12ff1d9264a60e8eeda35d885a" name="gabe95fc12ff1d9264a60e8eeda35d885a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gabe95fc12ff1d9264a60e8eeda35d885a">&#9670;&nbsp;</a></span>cyhal_i2s_start_tx()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a> cyhal_i2s_start_tx </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__hal__impl__hw__types.html#ga5c90028db813f9efe2a9e95b16caded4">cyhal_i2s_t</a> *&#160;</td>
          <td class="paramname"><em>obj</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Starts transmitting data. </p>
<p >Transmission will continue until it is stopped by calling <a class="el" href="group__group__hal__i2s.html#gae809b73f16e9dbc25e12c0c2687e1ba0">cyhal_i2s_stop_tx</a>.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">obj</td><td>The I2S object </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The status of the start request. </dd></dl>

</div>
</div>
<a id="gae809b73f16e9dbc25e12c0c2687e1ba0" name="gae809b73f16e9dbc25e12c0c2687e1ba0"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gae809b73f16e9dbc25e12c0c2687e1ba0">&#9670;&nbsp;</a></span>cyhal_i2s_stop_tx()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a> cyhal_i2s_stop_tx </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__hal__impl__hw__types.html#ga5c90028db813f9efe2a9e95b16caded4">cyhal_i2s_t</a> *&#160;</td>
          <td class="paramname"><em>obj</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Stops transmitting data. </p>
<p >This immediately terminates transmission.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">obj</td><td>The I2S object </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The status of the stop request. </dd></dl>

</div>
</div>
<a id="ga5b0c26d3c1193984873cfd1970287bdc" name="ga5b0c26d3c1193984873cfd1970287bdc"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga5b0c26d3c1193984873cfd1970287bdc">&#9670;&nbsp;</a></span>cyhal_i2s_clear_tx()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a> cyhal_i2s_clear_tx </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__hal__impl__hw__types.html#ga5c90028db813f9efe2a9e95b16caded4">cyhal_i2s_t</a> *&#160;</td>
          <td class="paramname"><em>obj</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Clears the tx hardware buffer. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">obj</td><td>The i2s peripheral </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The status of the clear request </dd></dl>

</div>
</div>
<a id="gabc95dd1600db8fdb379e7e7cc3d39039" name="gabc95dd1600db8fdb379e7e7cc3d39039"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gabc95dd1600db8fdb379e7e7cc3d39039">&#9670;&nbsp;</a></span>cyhal_i2s_start_rx()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a> cyhal_i2s_start_rx </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__hal__impl__hw__types.html#ga5c90028db813f9efe2a9e95b16caded4">cyhal_i2s_t</a> *&#160;</td>
          <td class="paramname"><em>obj</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Starts receiving data. </p>
<p >Data will continue to be received until it is stopped by calling <a class="el" href="group__group__hal__i2s.html#gad76c51ccedc76681490c74e7d859ee8a">cyhal_i2s_stop_rx</a>.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">obj</td><td>The I2S object </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The status of the start request. </dd></dl>

</div>
</div>
<a id="gad76c51ccedc76681490c74e7d859ee8a" name="gad76c51ccedc76681490c74e7d859ee8a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gad76c51ccedc76681490c74e7d859ee8a">&#9670;&nbsp;</a></span>cyhal_i2s_stop_rx()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a> cyhal_i2s_stop_rx </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__hal__impl__hw__types.html#ga5c90028db813f9efe2a9e95b16caded4">cyhal_i2s_t</a> *&#160;</td>
          <td class="paramname"><em>obj</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Stops receiving data. </p>
<p >This immediately terminates data receipt.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">obj</td><td>The I2S object </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The status of the stop request. </dd></dl>

</div>
</div>
<a id="ga0e0d62ba6e2038bd7c45b8c9cbdea88d" name="ga0e0d62ba6e2038bd7c45b8c9cbdea88d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga0e0d62ba6e2038bd7c45b8c9cbdea88d">&#9670;&nbsp;</a></span>cyhal_i2s_clear_rx()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a> cyhal_i2s_clear_rx </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__hal__impl__hw__types.html#ga5c90028db813f9efe2a9e95b16caded4">cyhal_i2s_t</a> *&#160;</td>
          <td class="paramname"><em>obj</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Clears the rx hardware buffer. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">obj</td><td>The i2s peripheral </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The status of the clear request </dd></dl>

</div>
</div>
<a id="ga29f8aaf72795492ac915dbddc0353c4c" name="ga29f8aaf72795492ac915dbddc0353c4c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga29f8aaf72795492ac915dbddc0353c4c">&#9670;&nbsp;</a></span>cyhal_i2s_read()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a> cyhal_i2s_read </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__hal__impl__hw__types.html#ga5c90028db813f9efe2a9e95b16caded4">cyhal_i2s_t</a> *&#160;</td>
          <td class="paramname"><em>obj</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>data</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t *&#160;</td>
          <td class="paramname"><em>length</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Read data synchronously. </p>
<p >This will read the number of words specified by the <code>length</code> parameter, or the number of words that are currently available in the receive buffer, whichever is less, then return. The value pointed to by <code>length</code> will be updated to reflect the number of words that were actually read.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">obj</td><td>The I2S object </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">data</td><td>The buffer for receiving </td></tr>
    <tr><td class="paramdir">[in,out]</td><td class="paramname">length</td><td>Number of words to (as configured in <a class="el" href="group__group__hal__i2s.html#af516514096f1a20028012346b78648ce" title="Number of bits in each word.">cyhal_i2s_config_t.word_length</a>) read, updated with the number actually read </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The status of the read request</dd></dl>
<dl class="section note"><dt>Note</dt><dd>Each word will be aligned to the next largest power of 2. For example, if the word length is 16 bits, each word will consume two bytes. But if the word length is 20, each word will consume 32 bytes. </dd></dl>
<dl class="section return"><dt>Returns</dt><dd>The status of the read request </dd></dl>

</div>
</div>
<a id="ga5362911702d7ab8687107159fb6a07e6" name="ga5362911702d7ab8687107159fb6a07e6"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga5362911702d7ab8687107159fb6a07e6">&#9670;&nbsp;</a></span>cyhal_i2s_write()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a> cyhal_i2s_write </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__hal__impl__hw__types.html#ga5c90028db813f9efe2a9e95b16caded4">cyhal_i2s_t</a> *&#160;</td>
          <td class="paramname"><em>obj</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const void *&#160;</td>
          <td class="paramname"><em>data</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t *&#160;</td>
          <td class="paramname"><em>length</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Send data synchronously. </p>
<p >This will write either <code>length</code> words or until the write buffer is full, whichever is less, then return. The value pointed to by <code>length</code> will be updated to reflect the number of words that were actually written. </p><dl class="section note"><dt>Note</dt><dd>This function only queues data into the write buffer; it does not block until the data has all been sent out over the wire.</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">obj</td><td>The I2S object </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">data</td><td>The buffer for sending </td></tr>
    <tr><td class="paramdir">[in,out]</td><td class="paramname">length</td><td>Number of words to write (as configured in <a class="el" href="group__group__hal__i2s.html#af516514096f1a20028012346b78648ce" title="Number of bits in each word.">cyhal_i2s_config_t.word_length</a>, updated with the number actually written </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The status of the write request</dd></dl>
<dl class="section note"><dt>Note</dt><dd>Each word will be aligned to the next largest power of 2. For example, if the word length is 16 bits, each word will consume two bytes. But if the word length is 20, each word will consume 32 bytes. </dd></dl>

</div>
</div>
<a id="ga6d036772b1ab51351907de2b1da7b8e4" name="ga6d036772b1ab51351907de2b1da7b8e4"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga6d036772b1ab51351907de2b1da7b8e4">&#9670;&nbsp;</a></span>cyhal_i2s_is_tx_enabled()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool cyhal_i2s_is_tx_enabled </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__hal__impl__hw__types.html#ga5c90028db813f9efe2a9e95b16caded4">cyhal_i2s_t</a> *&#160;</td>
          <td class="paramname"><em>obj</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Checks if the transmit functionality is enabled for the specified I2S peripheral (regardless of whether data is currently queued for transmission). </p>
<p >The transmit functionality can be enabled by calling <a class="el" href="group__group__hal__i2s.html#gabe95fc12ff1d9264a60e8eeda35d885a">cyhal_i2s_start_tx</a> and disabled by calling <a class="el" href="group__group__hal__i2s.html#gae809b73f16e9dbc25e12c0c2687e1ba0">cyhal_i2s_stop_tx</a></p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">obj</td><td>The I2S peripheral to check </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Whether the I2S transmit function is enabled. </dd></dl>

</div>
</div>
<a id="ga7204d762c6cff08d79916e12e66848b2" name="ga7204d762c6cff08d79916e12e66848b2"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga7204d762c6cff08d79916e12e66848b2">&#9670;&nbsp;</a></span>cyhal_i2s_is_tx_busy()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool cyhal_i2s_is_tx_busy </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__hal__impl__hw__types.html#ga5c90028db813f9efe2a9e95b16caded4">cyhal_i2s_t</a> *&#160;</td>
          <td class="paramname"><em>obj</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Checks if the specified I2S peripheral is transmitting data, including if a pending async transfer is waiting to write more data to the transmit buffer. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">obj</td><td>The I2S peripheral to check </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Whether the I2S is still transmitting </dd></dl>

</div>
</div>
<a id="gae5cbf3706ddde3acc4852025887190ba" name="gae5cbf3706ddde3acc4852025887190ba"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gae5cbf3706ddde3acc4852025887190ba">&#9670;&nbsp;</a></span>cyhal_i2s_is_rx_enabled()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool cyhal_i2s_is_rx_enabled </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__hal__impl__hw__types.html#ga5c90028db813f9efe2a9e95b16caded4">cyhal_i2s_t</a> *&#160;</td>
          <td class="paramname"><em>obj</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Checks if the receive functionality is enabled for the specified I2S peripheral (regardless of whether any unread data has been received). </p>
<p >The receive functionality can be enabled by calling <a class="el" href="group__group__hal__i2s.html#gabc95dd1600db8fdb379e7e7cc3d39039">cyhal_i2s_start_rx</a> and disabled by calling <a class="el" href="group__group__hal__i2s.html#gad76c51ccedc76681490c74e7d859ee8a">cyhal_i2s_stop_rx</a></p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">obj</td><td>The I2S peripheral to check </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Whether the I2S receive function is enabled. </dd></dl>

</div>
</div>
<a id="ga636ca3ae4d499af1c99af59bddf19166" name="ga636ca3ae4d499af1c99af59bddf19166"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga636ca3ae4d499af1c99af59bddf19166">&#9670;&nbsp;</a></span>cyhal_i2s_is_rx_busy()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool cyhal_i2s_is_rx_busy </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__hal__impl__hw__types.html#ga5c90028db813f9efe2a9e95b16caded4">cyhal_i2s_t</a> *&#160;</td>
          <td class="paramname"><em>obj</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Checks if the specified I2S peripheral has received data that has not yet been read out of the hardware buffer. </p>
<p >This includes if an async read transfer is pending.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">obj</td><td>The I2S peripheral to check </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Whether the I2S is still transmitting </dd></dl>

</div>
</div>
<a id="ga94357835c6f16b979680420f951d8980" name="ga94357835c6f16b979680420f951d8980"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga94357835c6f16b979680420f951d8980">&#9670;&nbsp;</a></span>cyhal_i2s_read_async()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a> cyhal_i2s_read_async </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__hal__impl__hw__types.html#ga5c90028db813f9efe2a9e95b16caded4">cyhal_i2s_t</a> *&#160;</td>
          <td class="paramname"><em>obj</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>rx</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>rx_length</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Start I2S asynchronous read. </p>
<p >This will transfer <code>rx_length</code> words into the buffer pointed to by <code>rx</code> in the background. When the requested quantity of data has been read, the <a class="el" href="group__group__hal__i2s.html#gga98bc78188673aae2c4e27b660a3f20feab4a3a412a6b61efbd39ab540120713e9">CYHAL_I2S_ASYNC_RX_COMPLETE</a> event will be raised. See <a class="el" href="group__group__hal__i2s.html#gade0855962b32a1b4d4dbb9bbf9b6354b">cyhal_i2s_register_callback</a> and <a class="el" href="group__group__hal__i2s.html#gac8adecacf62147f30023e69010b52bf9">cyhal_i2s_enable_event</a>.</p>
<p >cyhal_i2s_set_async_mode can be used to control whether this uses DMA or a CPU-driven transfer.</p>
<dl class="section note"><dt>Note</dt><dd>If D-cache is enabled, cyhal_i2s_set_async_mode is DMA and data Cache line is 32 bytes, the user needs to make sure that the rx pointer passed to the cyhal_i2s_read_async function points to a 32 byte aligned array of words that contains the buffer data. The size of buffer data must be a multiple of 32 bytes to ensure cache coherency. CY_ALIGN(__SCB_DCACHE_LINE_SIZE) macro can be used for 32 byte alignment.</dd></dl>
<p>Refer to <a class="el" href="md_source_hal_dcache.html#DCACHE_Management">DCACHE_Management</a> for more information.</p>
<dl class="section note"><dt>Note</dt><dd>Each word will be aligned to the next largest power of 2. For example, if the word length is 16 bits, each word will consume two bytes. But if the word length is 20, each word will consume 32 bytes.</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">obj</td><td>The I2S object </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">rx</td><td>The receive buffer. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">rx_length</td><td>Number of words (as configured in <a class="el" href="group__group__hal__i2s.html#af516514096f1a20028012346b78648ce" title="Number of bits in each word.">cyhal_i2s_config_t.word_length</a>) to read. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The status of the read_async request </dd></dl>

</div>
</div>
<a id="ga5f4dd73de0bd46bee15d82fe793f5ca3" name="ga5f4dd73de0bd46bee15d82fe793f5ca3"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga5f4dd73de0bd46bee15d82fe793f5ca3">&#9670;&nbsp;</a></span>cyhal_i2s_write_async()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a> cyhal_i2s_write_async </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__hal__impl__hw__types.html#ga5c90028db813f9efe2a9e95b16caded4">cyhal_i2s_t</a> *&#160;</td>
          <td class="paramname"><em>obj</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const void *&#160;</td>
          <td class="paramname"><em>tx</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>tx_length</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Start I2S asynchronous write. </p>
<p >This will transfer <code>tx_length</code> words into the tx buffer in the background. When the requested quantity of data has been queued in the transmit buffer, the <a class="el" href="group__group__hal__i2s.html#gga98bc78188673aae2c4e27b660a3f20fea090269cec878bec745bb2e393606e41e">CYHAL_I2S_ASYNC_TX_COMPLETE</a> event will be raised. See <a class="el" href="group__group__hal__i2s.html#gade0855962b32a1b4d4dbb9bbf9b6354b">cyhal_i2s_register_callback</a> and <a class="el" href="group__group__hal__i2s.html#gac8adecacf62147f30023e69010b52bf9">cyhal_i2s_enable_event</a>.</p>
<p >cyhal_i2s_set_async_mode can be used to control whether this uses DMA or a SW (CPU-driven) transfer.</p>
<dl class="section note"><dt>Note</dt><dd>If D-cache is enabled, cyhal_i2s_set_async_mode is DMA and data Cache line is 32 bytes, the user needs to make sure that the tx pointer passed to the cyhal_i2s_write_async function points to a 32 byte aligned array of words that contains the buffer data. The size of buffer data must be a multiple of 32 bytes to ensure cache coherency. CY_ALIGN(__SCB_DCACHE_LINE_SIZE) macro can be used for 32 byte alignment.</dd></dl>
<p>Refer to <a class="el" href="md_source_hal_dcache.html#DCACHE_Management">DCACHE_Management</a> for more information.</p>
<dl class="section note"><dt>Note</dt><dd>Each word will be aligned to the next largest power of 2. For example, if the word length is 16 bits, each word will consume two bytes. But if the word length is 20, each word will consume 32 bytes.</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">obj</td><td>The I2S object </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">tx</td><td>The transmit buffer. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">tx_length</td><td>The number of words to transmit. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The status of the transfer_async request </dd></dl>

</div>
</div>
<a id="ga9fba9ea64bd2ec92a2ae41459020825c" name="ga9fba9ea64bd2ec92a2ae41459020825c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga9fba9ea64bd2ec92a2ae41459020825c">&#9670;&nbsp;</a></span>cyhal_i2s_set_async_mode()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a> cyhal_i2s_set_async_mode </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__hal__impl__hw__types.html#ga5c90028db813f9efe2a9e95b16caded4">cyhal_i2s_t</a> *&#160;</td>
          <td class="paramname"><em>obj</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__group__hal__general__types.html#gab2d2acfb82599df54152be0b170c6ec2">cyhal_async_mode_t</a>&#160;</td>
          <td class="paramname"><em>mode</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>dma_priority</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Set the mechanism that is used to perform I2S asynchronous transfers. </p>
<p >The default is SW. </p><dl class="section warning"><dt>Warning</dt><dd>The effect of calling this function while an async transfer is pending is undefined.</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">obj</td><td>The I2S object </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">mode</td><td>The transfer mode </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">dma_priority</td><td>The priority, if DMA is used. Valid values are the same as for <a class="el" href="group__group__hal__dma.html#gab9c200507a8ee87b894150416e4f5dd1">cyhal_dma_init</a>. If DMA is not selected, the only valid value is CYHAL_DMA_PRIORITY_DEFAULT, and no guarantees are made about prioritization. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The status of the set mode request </dd></dl>

</div>
</div>
<a id="ga9ee30034685c4559212a5180ecfac7dc" name="ga9ee30034685c4559212a5180ecfac7dc"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga9ee30034685c4559212a5180ecfac7dc">&#9670;&nbsp;</a></span>cyhal_i2s_is_read_pending()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool cyhal_i2s_is_read_pending </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__hal__impl__hw__types.html#ga5c90028db813f9efe2a9e95b16caded4">cyhal_i2s_t</a> *&#160;</td>
          <td class="paramname"><em>obj</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Checks if the specified I2S peripheral is in the process of reading data from the hardware buffer into RAM. </p>
<dl class="section note"><dt>Note</dt><dd>: This only checks whether there is an ongoing transfer (e.g. via cyhal_i2s_read_async) into RAM from the I2S peripheral's hardware buffer. It does not check whether unread data exists in the hardware buffer.</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">obj</td><td>The I2S peripheral to check </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Whether an asynchronous read operation is still in progress </dd></dl>

</div>
</div>
<a id="ga3e151230ed3442aed1295ee2a3d8e8bf" name="ga3e151230ed3442aed1295ee2a3d8e8bf"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga3e151230ed3442aed1295ee2a3d8e8bf">&#9670;&nbsp;</a></span>cyhal_i2s_is_write_pending()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool cyhal_i2s_is_write_pending </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__hal__impl__hw__types.html#ga5c90028db813f9efe2a9e95b16caded4">cyhal_i2s_t</a> *&#160;</td>
          <td class="paramname"><em>obj</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Checks if the specified I2S peripheral is in the process of writing data into the hardware buffer. </p>
<dl class="section note"><dt>Note</dt><dd>: This only checks whether there is an ongoing transfer (e.g. via cyhal_i2s_transfer_async) from RAM into the I2S peripheral's hardware buffer. It does not check whether unwritten data exists in the hardware buffer.</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">obj</td><td>The I2S peripheral to check </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Whether an asynchronous write operation is still in progress </dd></dl>

</div>
</div>
<a id="ga9d755179f6a38da673df11331541e2e6" name="ga9d755179f6a38da673df11331541e2e6"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga9d755179f6a38da673df11331541e2e6">&#9670;&nbsp;</a></span>cyhal_i2s_abort_read_async()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a> cyhal_i2s_abort_read_async </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__hal__impl__hw__types.html#ga5c90028db813f9efe2a9e95b16caded4">cyhal_i2s_t</a> *&#160;</td>
          <td class="paramname"><em>obj</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Abort I2S asynchronous read. </p>
<p >This function does not perform any validation before aborting the transfer. Any validation which is required is the responsibility of the application.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">obj</td><td>The I2S object </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The status of the abort_async_read request </dd></dl>

</div>
</div>
<a id="gaf15b5df60f51c5678931e06ddb3c9fb6" name="gaf15b5df60f51c5678931e06ddb3c9fb6"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaf15b5df60f51c5678931e06ddb3c9fb6">&#9670;&nbsp;</a></span>cyhal_i2s_abort_write_async()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a> cyhal_i2s_abort_write_async </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__hal__impl__hw__types.html#ga5c90028db813f9efe2a9e95b16caded4">cyhal_i2s_t</a> *&#160;</td>
          <td class="paramname"><em>obj</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Abort I2S asynchronous write. </p>
<p >This function does not perform any validation before aborting the transfer. Any validation which is required is the responsibility of the application.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">obj</td><td>The I2S object </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The status of the abort_async_write request </dd></dl>

</div>
</div>
<a id="gade0855962b32a1b4d4dbb9bbf9b6354b" name="gade0855962b32a1b4d4dbb9bbf9b6354b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gade0855962b32a1b4d4dbb9bbf9b6354b">&#9670;&nbsp;</a></span>cyhal_i2s_register_callback()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void cyhal_i2s_register_callback </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__hal__impl__hw__types.html#ga5c90028db813f9efe2a9e95b16caded4">cyhal_i2s_t</a> *&#160;</td>
          <td class="paramname"><em>obj</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__group__hal__i2s.html#ga7c7aa98ff4eb219144157f2af9a9c794">cyhal_i2s_event_callback_t</a>&#160;</td>
          <td class="paramname"><em>callback</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>callback_arg</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Register an I2S callback handler. </p>
<p >This function will be called when one of the events enabled by <a class="el" href="group__group__hal__i2s.html#gac8adecacf62147f30023e69010b52bf9">cyhal_i2s_enable_event</a> occurs.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">obj</td><td>The I2S object </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">callback</td><td>The callback handler which will be invoked when the interrupt fires </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">callback_arg</td><td>Generic argument that will be provided to the callback when called </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="gac8adecacf62147f30023e69010b52bf9" name="gac8adecacf62147f30023e69010b52bf9"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gac8adecacf62147f30023e69010b52bf9">&#9670;&nbsp;</a></span>cyhal_i2s_enable_event()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void cyhal_i2s_enable_event </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__hal__impl__hw__types.html#ga5c90028db813f9efe2a9e95b16caded4">cyhal_i2s_t</a> *&#160;</td>
          <td class="paramname"><em>obj</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__group__hal__i2s.html#ga98bc78188673aae2c4e27b660a3f20fe">cyhal_i2s_event_t</a>&#160;</td>
          <td class="paramname"><em>event</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>intr_priority</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>enable</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Configure I2S events. </p>
<p >When an enabled event occurs, the function specified by <a class="el" href="group__group__hal__i2s.html#gade0855962b32a1b4d4dbb9bbf9b6354b">cyhal_i2s_register_callback</a> will be called.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">obj</td><td>The I2S object </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">event</td><td>The I2S event type </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">intr_priority</td><td>The priority for NVIC interrupt events </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">enable</td><td>True to turn on specified events, False to turn off </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="gabdfe29741f8040cf92d99fad53195af5" name="gabdfe29741f8040cf92d99fad53195af5"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gabdfe29741f8040cf92d99fad53195af5">&#9670;&nbsp;</a></span>cyhal_i2s_enable_output()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a> cyhal_i2s_enable_output </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__hal__impl__hw__types.html#ga5c90028db813f9efe2a9e95b16caded4">cyhal_i2s_t</a> *&#160;</td>
          <td class="paramname"><em>obj</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__group__hal__i2s.html#ga6f7d46b47e52fa549fed8a8490b10e6e">cyhal_i2s_output_t</a>&#160;</td>
          <td class="paramname"><em>output</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__group__hal__impl__triggers__psoc6__01.html#ga96236d1368f920d28af90262e8b57046">cyhal_source_t</a> *&#160;</td>
          <td class="paramname"><em>source</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Enables the specified output signal. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">obj</td><td>The I2S object </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">output</td><td>Which output signal to enable </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">source</td><td>Pointer to user-allocated source signal object which will be initialized by enable_output. <code>source</code> should be passed to (dis)connect_digital functions to (dis)connect the associated endpoints. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The status of the output enable </dd></dl>

</div>
</div>
<a id="gae9a3a32cb4292687b2ff2bca54d29b62" name="gae9a3a32cb4292687b2ff2bca54d29b62"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gae9a3a32cb4292687b2ff2bca54d29b62">&#9670;&nbsp;</a></span>cyhal_i2s_disable_output()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a> cyhal_i2s_disable_output </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__hal__impl__hw__types.html#ga5c90028db813f9efe2a9e95b16caded4">cyhal_i2s_t</a> *&#160;</td>
          <td class="paramname"><em>obj</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__group__hal__i2s.html#ga6f7d46b47e52fa549fed8a8490b10e6e">cyhal_i2s_output_t</a>&#160;</td>
          <td class="paramname"><em>output</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Disables the specified output signal. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">obj</td><td>The I2S object </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">output</td><td>Which output signal to disable</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The status of the disablement </dd></dl>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part
<div id="nav-path" class="navpath">
    <ul>
        <li class="footer">
            Generated for <b>Hardware Abstraction Layer (HAL)</b> by <b>Cypress Semiconductor Corporation</b>.
            All rights reserved.
        </li>
    </ul>
</div>
-->
</body>
</html>
